Exemple #1
0
 /// <summary>
 ///  Creates a new DeviceCodeCredential with the specified options, which will authenticate users using the device code flow.
 /// </summary>
 /// <param name="deviceCodeCallback">The callback to be executed to display the device code to the user.</param>
 /// <param name="options">The client options for the newly created <see cref="DeviceCodeCredential"/>.</param>
 internal DeviceCodeCredential(Func <DeviceCodeInfo, CancellationToken, Task> deviceCodeCallback, DeviceCodeCredentialOptions options = default)
     : this(deviceCodeCallback, options?.TenantId, options?.ClientId, options, null)
 {
     _disableAutomaticAuthentication = options?.DisableAutomaticAuthentication ?? false;
     _record = options?.AuthenticationRecord;
 }
Exemple #2
0
 /// <summary>
 ///  Creates a new <see cref="DeviceCodeCredential"/> with the specified options, which will authenticate users using the device code flow, printing the device code message to stdout.
 /// </summary>
 /// <param name="options">The client options for the newly created <see cref="DeviceCodeCredential"/>.</param>
 public DeviceCodeCredential(DeviceCodeCredentialOptions options)
     : this(DefaultDeviceCodeHandler, options?.TenantId, options?.ClientId, options, null)
 {
 }
 /// <summary>
 ///  Creates a new <see cref="DeviceCodeCredential"/> with the specified options, which will authenticate users using the device code flow.
 /// </summary>
 /// <param name="options">The client options for the newly created <see cref="DeviceCodeCredential"/>.</param>
 public DeviceCodeCredential(DeviceCodeCredentialOptions options)
     : this(options?.DeviceCodeCallback ?? DefaultDeviceCodeHandler, options?.TenantId, options?.ClientId ?? Constants.DeveloperSignOnClientId, options, null)
 {
 }
 /// <summary>
 ///  Creates a new DeviceCodeCredential with the specified options, which will authenticate users using the device code flow.
 /// </summary>
 /// <param name="deviceCodeCallback">The callback to be executed to display the device code to the user.</param>
 /// <param name="options">The client options for the newly created <see cref="DeviceCodeCredential"/>.</param>
 public DeviceCodeCredential(Func <DeviceCodeInfo, CancellationToken, Task> deviceCodeCallback, DeviceCodeCredentialOptions options = default)
     : this(deviceCodeCallback, options?.TenantId, options?.ClientId, CredentialPipeline.GetInstance(options), options)
 {
     _disableAutomaticAuthentication = options?.DisableAutomaticAuthentication ?? false;
     _record = options?.AuthenticationRecord;
 }