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

Co-authored-by: David Engel <dengel@magnitude.com>
Copy link
Contributor

@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.

@cheenamalhotra cheenamalhotra removed this from the 2.0.0 milestone Jun 12, 2020
Co-authored-by: David Engel <dengel@magnitude.com>
@cheenamalhotra cheenamalhotra merged commit b5319c4 into dotnet:master 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
None yet
Development

Successfully merging this pull request may close these issues.

6 participants