Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ private static ConcurrentDictionary<PublicClientAppKey, IPublicClientApplication
private readonly string _applicationClientId = ActiveDirectoryAuthentication.AdoClientId;

/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/ActiveDirectoryAuthenticationProvider.xml' path='docs/members[@name="ActiveDirectoryAuthenticationProvider"]/ctor/*'/>
public ActiveDirectoryAuthenticationProvider() => new ActiveDirectoryAuthenticationProvider(DefaultDeviceFlowCallback);
public ActiveDirectoryAuthenticationProvider()
: this(DefaultDeviceFlowCallback)
{
}

/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/ActiveDirectoryAuthenticationProvider.xml' path='docs/members[@name="ActiveDirectoryAuthenticationProvider"]/ctor2/*'/>
public ActiveDirectoryAuthenticationProvider(string applicationClientId) => new ActiveDirectoryAuthenticationProvider(DefaultDeviceFlowCallback, applicationClientId);
public ActiveDirectoryAuthenticationProvider(string applicationClientId)
: this(DefaultDeviceFlowCallback, applicationClientId)
{
}

/// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/ActiveDirectoryAuthenticationProvider.xml' path='docs/members[@name="ActiveDirectoryAuthenticationProvider"]/ctor3/*'/>
public ActiveDirectoryAuthenticationProvider(Func<DeviceCodeResult, Task> deviceCodeFlowCallbackMethod, string applicationClientId = null)
Expand Down Expand Up @@ -215,7 +221,7 @@ public override async Task<SqlAuthenticationToken> AcquireTokenAsync(SqlAuthenti
{
// Fetch available accounts from 'app' instance
System.Collections.Generic.IEnumerator<IAccount> accounts = (await app.GetAccountsAsync()).GetEnumerator();

IAccount account = default;
if (accounts.MoveNext())
{
Expand Down Expand Up @@ -343,7 +349,7 @@ private async Task<AuthenticationResult> AcquireTokenInteractiveDeviceFlowAsync(
}
}

private Task DefaultDeviceFlowCallback(DeviceCodeResult result)
private static Task DefaultDeviceFlowCallback(DeviceCodeResult result)
{
// This will print the message on the console which tells the user where to go sign-in using
// a separate browser and the code to enter once they sign in.
Expand Down