Package com.azure.identity
Class AuthenticationRequiredException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.azure.core.exception.AzureException
com.azure.core.exception.HttpResponseException
com.azure.core.exception.ClientAuthenticationException
com.azure.identity.CredentialUnavailableException
com.azure.identity.AuthenticationRequiredException
- All Implemented Interfaces:
Serializable
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 InteractiveBrowserCredential.authenticate() or
DeviceCodeCredential.authenticate() APIs respectively before fetching an access token.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationRequiredException(String message, com.azure.core.credential.TokenRequestContext request) Initializes a new instance of theAuthenticationRequiredExceptionclass.AuthenticationRequiredException(String message, com.azure.core.credential.TokenRequestContext request, Throwable cause) Initializes a new instance of theAuthenticationRequiredExceptionclass. -
Method Summary
Modifier and TypeMethodDescriptioncom.azure.core.credential.TokenRequestContextGet the details of the authentication request which resulted in the authentication failure.Methods inherited from class com.azure.core.exception.HttpResponseException
getResponse, getValueMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AuthenticationRequiredException
public AuthenticationRequiredException(String message, com.azure.core.credential.TokenRequestContext request) Initializes a new instance of theAuthenticationRequiredExceptionclass.- Parameters:
message- The exception message.request- The details of the authentication request.
-
AuthenticationRequiredException
public AuthenticationRequiredException(String message, com.azure.core.credential.TokenRequestContext request, Throwable cause) Initializes a new instance of theAuthenticationRequiredExceptionclass.- Parameters:
message- The exception message.request- The details of the authentication request.cause- TheThrowablewhich caused the creation of this exception.
-
-
Method Details
-
getTokenRequestContext
public com.azure.core.credential.TokenRequestContext getTokenRequestContext()Get the details of the authentication request which resulted in the authentication failure.- Returns:
- the token request context.
-