InteractiveBrowserCredential Class

  • java.lang.Object
    • com.azure.identity.InteractiveBrowserCredential

Implements

public class InteractiveBrowserCredential
implements 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 Type Method and Description

Mono<AuthenticationRecord>

authenticate()

Interactively authenticates a user via the default browser.

Mono<AuthenticationRecord>

authenticate(TokenRequestContext request)

Interactively authenticates a user via the default browser.

Mono<AccessToken>

getToken(TokenRequestContext request)
AccessToken getTokenSync(TokenRequestContext request)

Methods inherited from java.lang.Object

Method Details

authenticate

public Mono 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 via tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions) when credential was instantiated.

authenticate

public Mono authenticate(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 via tokenCachePersistenceOptions(TokenCachePersistenceOptions tokenCachePersistenceOptions) when credential was instantiated.

getToken

public Mono getToken(TokenRequestContext request)

Parameters:

request

getTokenSync

public AccessToken getTokenSync(TokenRequestContext request)

Parameters:

request

Applies to