Package com.azure.identity
Class InteractiveBrowserCredential
java.lang.Object
com.azure.identity.InteractiveBrowserCredential
- All Implemented Interfaces:
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
(TokenRequestContext request) Interactively authenticates a user via the default browser.getToken
(TokenRequestContext request) Asynchronously get a token for a given resource/audience.
-
Method Details
-
getToken
Description copied from interface:TokenCredential
Asynchronously get a token for a given resource/audience. This method is called automatically by Azure SDK client libraries. You may call this method directly, but you must also handle token caching and token refreshing.- Specified by:
getToken
in interfaceTokenCredential
- Parameters:
request
- the details of the token request- Returns:
- a Publisher that emits a single access token
-
authenticate
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.
-