public class DeviceCodeCredential extends Object implements com.azure.core.credential.TokenCredential
| Modifier and Type | Method and Description |
|---|---|
Mono<AuthenticationRecord> |
authenticate()
Authenticates a user via the device code flow.
|
Mono<AuthenticationRecord> |
authenticate(com.azure.core.credential.TokenRequestContext request)
Authenticates a user via the device code flow.
|
Mono<com.azure.core.credential.AccessToken> |
getToken(com.azure.core.credential.TokenRequestContext request) |
public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request)
getToken in interface com.azure.core.credential.TokenCredentialpublic Mono<AuthenticationRecord> authenticate(com.azure.core.credential.TokenRequestContext request)
The credential acquires a verification URL and code from the Azure Active Directory. The user must browse to the URL, enter the code, and authenticate with Azure Active Directory. If the user authenticates successfully, the credential receives an access token.
request - The details of the authentication request.AuthenticationRecord which can be used to silently authenticate the account
on future execution if persistent caching was configured via
DeviceCodeCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions)
when credential was instantiated.public Mono<AuthenticationRecord> authenticate()
The credential acquires a verification URL and code from the Azure Active Directory. The user must browse to the URL, enter the code, and authenticate with Azure Active Directory. If the user authenticates successfully, the credential receives an access token.
AuthenticationRecord which can be used to silently authenticate the account
on future execution if persistent caching was configured via
DeviceCodeCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions)
when credential was instantiated.Visit the Azure for Java Developers site for more Java documentation, including quick starts, tutorials, and code samples.