public class DeviceCodeCredentialBuilder extends AadCredentialBuilderBase<DeviceCodeCredentialBuilder>
DeviceCodeCredential.DeviceCodeCredential| Constructor and Description |
|---|
DeviceCodeCredentialBuilder() |
| Modifier and Type | Method and Description |
|---|---|
DeviceCodeCredentialBuilder |
authenticationRecord(AuthenticationRecord authenticationRecord)
Sets the
AuthenticationRecord captured from a previous authentication. |
DeviceCodeCredential |
build()
Creates a new
DeviceCodeCredential with the current configurations. |
DeviceCodeCredentialBuilder |
challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer)
Sets the consumer to meet the device code challenge.
|
DeviceCodeCredentialBuilder |
disableAutomaticAuthentication()
Disables the automatic authentication and prevents the
DeviceCodeCredential from automatically
prompting the user. |
DeviceCodeCredentialBuilder |
tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
Configures the persistent shared token cache options and enables the persistent token cache which is disabled
by default.
|
authorityHost, clientId, executorService, tenantIdconfiguration, httpClient, httpPipeline, maxRetry, proxyOptions, retryTimeoutpublic DeviceCodeCredentialBuilder challengeConsumer(Consumer<DeviceCodeInfo> challengeConsumer)
challengeConsumer - A method allowing the user to meet the device code challenge.public DeviceCodeCredentialBuilder tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions)
tokenCachePersistenceOptions - the token cache configuration optionspublic DeviceCodeCredentialBuilder authenticationRecord(AuthenticationRecord authenticationRecord)
AuthenticationRecord captured from a previous authentication.authenticationRecord - the authentication record to be configured.public DeviceCodeCredentialBuilder disableAutomaticAuthentication()
DeviceCodeCredential from automatically
prompting the user. If automatic authentication is disabled a AuthenticationRequiredException
will be thrown from DeviceCodeCredential.getToken(TokenRequestContext) in the case that
user interaction is necessary. The application is responsible for handling this exception, and
calling DeviceCodeCredential.authenticate() or
DeviceCodeCredential.authenticate(TokenRequestContext) to authenticate the user interactively.public DeviceCodeCredential build()
DeviceCodeCredential with the current configurations.DeviceCodeCredential with the current configurations.Visit the Azure for Java Developers site for more Java documentation, including quick starts, tutorials, and code samples.