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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<AuthenticationRecord>
authenticate()
Interactively authenticates a user via the default browser.Mono<AuthenticationRecord>
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)
-
-
-
Method Detail
-
getToken
public Mono<com.azure.core.credential.AccessToken> getToken(com.azure.core.credential.TokenRequestContext request)
- Specified by:
getToken
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
public Mono<AuthenticationRecord> 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.
-
-