Azure.Identity.DeviceCodeCredentialOptions
public class DeviceCodeCredentialOptions : TokenCredentialOptions, ISupportsTokenCachePersistenceOptions, ISupportsDisableInstanceDiscovery, ISupportsAdditionallyAllowedTenants, ISupportsTenantId
Options to configure the DeviceCodeCredential.
Specifies tenants in addition to the specified TenantId for which the credential may acquire tokens.
Add the wildcard value "*" to allow the credential to acquire tokens for any tenant the logged in account can access.
If no value is specified for TenantId, this option will have no effect, and the credential will acquire tokens for any requested tenant.
The AuthenticationRecord captured from a previous authentication.
The client ID of the application used to authenticate the user. If not specified the user will be authenticated with an Azure development application.
It is recommended that developers register their applications and assign appropriate roles. For more information, visit .
If not specified, users will authenticate to an Azure development application, which is not recommended for production scenarios.
The callback which will be executed to display the device code login details to the user. In not specified the device code and login instructions will be printed to the console.
Prevents the DeviceCodeCredential from automatically prompting the user. If automatic authentication is disabled a AuthenticationRequiredException will be thrown from GetToken and GetTokenAsync in the case that
user interaction is necessary. The application is responsible for handling this exception, and calling Authenticate or AuthenticateAsync to authenticate the user interactively.
Gets or sets the setting which determines whether or not instance discovery is performed when attempting to authenticate.
Setting this to true will completely disable both instance discovery and authority validation.
This functionality is intended for use in scenarios where the metadata endpoint cannot be reached, such as in private clouds or Azure Stack.
The process of instance discovery entails retrieving authority metadata from https://login.microsoft.com/ to validate the authority.
By setting this to true, the validation of the authority is disabled.
As a result, it is crucial to ensure that the configured authority host is valid and trustworthy."
The tenant ID the user will be authenticated to. If not specified the user will be authenticated to their home tenant.
Specifies the TokenCachePersistenceOptions to be used by the credential. If not options are specified, the token cache will not be persisted to disk.
public DeviceCodeCredentialOptions()