Class OAuth2AuthenticationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.core.AuthenticationException
org.springframework.security.oauth2.core.OAuth2AuthenticationException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
InvalidBearerTokenException
This exception is thrown for all OAuth 2.0 related
Authentication
errors.
There are a number of scenarios where an error may occur, for example:
- The authorization request or token request is missing a required parameter
- Missing or invalid client identifier
- Invalid or mismatching redirection URI
- The requested scope is invalid, unknown, or malformed
- The resource owner or authorization server denied the access request
- Client authentication failed
- The provided authorization grant (authorization code, resource owner credentials) is invalid, expired, or revoked
- Since:
- 5.0
- See Also:
-
Constructor Summary
ConstructorDescriptionOAuth2AuthenticationException
(String errorCode) Constructs anOAuth2AuthenticationException
using the provided parameters.Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException
(OAuth2Error error, String message) Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException
(OAuth2Error error, String message, Throwable cause) Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException
(OAuth2Error error, Throwable cause) Constructs anOAuth2AuthenticationException
using the provided parameters. -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OAuth2AuthenticationException
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
errorCode
- theOAuth 2.0 Error Code
- Since:
- 5.5
-
OAuth2AuthenticationException
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
-
OAuth2AuthenticationException
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
cause
- the root cause
-
OAuth2AuthenticationException
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
message
- the detail message
-
OAuth2AuthenticationException
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
message
- the detail messagecause
- the root cause
-
-
Method Details
-
getError
Returns theOAuth 2.0 Error
.- Returns:
- the
OAuth2Error
-