Package com.azure.identity
Class InteractiveBrowserCredential
java.lang.Object
com.azure.identity.InteractiveBrowserCredential
- All Implemented Interfaces:
com.azure.core.credential.TokenCredential
public class InteractiveBrowserCredential
extends Object
implements com.azure.core.credential.TokenCredential
An AAD credential that acquires a token for an AAD application by prompting the login in the default browser. When
authenticated, the oauth2 flow will notify the credential of the authentication code through the reply URL.
The application to authenticate to must have delegated user login permissions and have
http://localhost:{port}
listed as a valid reply URL.
-
Method Summary
Modifier and TypeMethodDescriptionInteractively authenticates a user via the default browser.authenticate
(com.azure.core.credential.TokenRequestContext request) Interactively authenticates a user via the default browser.Mono<com.azure.core.credential.AccessToken>
getToken
(com.azure.core.credential.TokenRequestContext request) com.azure.core.credential.AccessToken
getTokenSync
(com.azure.core.credential.TokenRequestContext request)
-
Method Details
-
getToken
public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request) - Specified by:
getToken
in interfacecom.azure.core.credential.TokenCredential
-
getTokenSync
public com.azure.core.credential.AccessToken getTokenSync(com.azure.core.credential.TokenRequestContext request) - Specified by:
getTokenSync
in interfacecom.azure.core.credential.TokenCredential
-
authenticate
public Mono<AuthenticationRecord> authenticate(com.azure.core.credential.TokenRequestContext request) Interactively authenticates a user via the default browser.- Parameters:
request
- The details of the authentication request.- Returns:
- The
AuthenticationRecord
which can be used to silently authenticate the account on future execution if persistent caching was configured viaInteractiveBrowserCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions)
when credential was instantiated.
-
authenticate
Interactively authenticates a user via the default browser.- Returns:
- The
AuthenticationRecord
which can be used to silently authenticate the account on future execution if persistent caching was enabled viaInteractiveBrowserCredentialBuilder.tokenCachePersistenceOptions(TokenCachePersistenceOptions)
when credential was instantiated.
-