AuthenticationRequiredException Class

public final class AuthenticationRequiredException
extends CredentialUnavailableException

The Authentication Required Exception is thrown by InteractiveBrowserCredential and DeviceCodeCredential to indicate to the user that automatic authentication is disabled and authentication needs to be initiated via authenticate() or authenticate() APIs respectively before fetching an access token.

Constructor Summary

Constructor Description
AuthenticationRequiredException(String message, TokenRequestContext request)

Initializes a new instance of the AuthenticationRequiredException class.

AuthenticationRequiredException(String message, TokenRequestContext request, Throwable cause)

Initializes a new instance of the AuthenticationRequiredException class.

Method Summary

Modifier and Type Method and Description
TokenRequestContext getTokenRequestContext()

Get the details of the authentication request which resulted in the authentication failure.

Methods inherited from HttpResponseException

Methods inherited from java.lang.Object

Methods inherited from java.lang.Throwable

Constructor Details

AuthenticationRequiredException

public AuthenticationRequiredException(String message, TokenRequestContext request)

Initializes a new instance of the AuthenticationRequiredException class.

Parameters:

message - The exception message.
request - The details of the authentication request.

AuthenticationRequiredException

public AuthenticationRequiredException(String message, TokenRequestContext request, Throwable cause)

Initializes a new instance of the AuthenticationRequiredException class.

Parameters:

message - The exception message.
request - The details of the authentication request.
cause - The Throwable which caused the creation of this exception.

Method Details

getTokenRequestContext

public TokenRequestContext getTokenRequestContext()

Get the details of the authentication request which resulted in the authentication failure.

Returns:

the token request context.

Applies to