Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce support for AAD Device Code Flow authentication #597

Merged
merged 17 commits into from Jul 27, 2020

Conversation

cheenamalhotra
Copy link
Member

@cheenamalhotra cheenamalhotra commented Jun 10, 2020

This PR adds support for "Device Code Flow" authentication mode with MSAL.NET.
Reference documentation: OAuth2.0 Device Authorization Grant flow

Example of Connection string:

Server=<server>.database.windows.net; Authentication=Active Directory Device Code Flow; Database=Northwind;

Also enables customization of Device Code Flow callback with below API:
ActiveDirectoryAuthenticationProvider.SetDeviceCodeFlowCallback(Func<DeviceCodeResult, Task> deviceCodeFlowCallbackMethod)

Edit:

Added new APIs as under to enable customizations for "Active Directory Interactive" authentication experience:

  • ActiveDirectoryAuthenticationProvider.SetIWin32WindowFunc(Func<IWin32Window> iWin32WindowFunc)
    -- Applies to .NET Framework only
  • ActiveDirectoryAuthenticationProvider.SetParentActivityOrWindowFunc(Func<object> parentActivityOrWindowFunc)
    -- Applies to .NET Standard only
  • ActiveDirectoryAuthenticationProvider.SetCustomWebUi(ICustomWebUi customWebUi)
    -- Applies to .NET Framework, .NET Core and .NET Standard

@cheenamalhotra cheenamalhotra added this to In progress in SqlClient v2.0.0 via automation Jun 10, 2020
@cheenamalhotra cheenamalhotra added this to the 2.0.0 milestone Jun 10, 2020
Co-authored-by: David Engel <dengel@magnitude.com>
Copy link

@saurabh500 saurabh500 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM from API perspective.

SqlClient v2.0.0 automation moved this from In progress to Reviewer approved Jun 11, 2020
@cheenamalhotra cheenamalhotra removed this from Reviewer approved in SqlClient v2.0.0 Jun 12, 2020
@cheenamalhotra cheenamalhotra removed this from the 2.0.0 milestone Jun 12, 2020
@cheenamalhotra cheenamalhotra added this to the 2.1.0-preview1 milestone Jun 30, 2020
@cheenamalhotra cheenamalhotra added this to In progress in SqlClient v2.1 via automation Jun 30, 2020
@cheenamalhotra cheenamalhotra moved this from In progress to Review in progress in SqlClient v2.1 Jul 8, 2020
Co-authored-by: David Engel <dengel@magnitude.com>
SqlClient v2.1 automation moved this from Review in progress to Reviewer approved Jul 21, 2020
@cheenamalhotra cheenamalhotra merged commit b5319c4 into dotnet:master Jul 27, 2020
SqlClient v2.1 automation moved this from Reviewer approved to Done Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 Public API Use this label for new API additions to the driver.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

6 participants