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:
java.io.Serializable
- Direct Known Subclasses:
InvalidBearerTokenException
public class OAuth2AuthenticationException extends AuthenticationException
This exception is thrown for all OAuth 2.0 relatedAuthentication
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OAuth2AuthenticationException(java.lang.String errorCode)
Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException(OAuth2Error error)
Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException(OAuth2Error error, java.lang.String message)
Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException(OAuth2Error error, java.lang.String message, java.lang.Throwable cause)
Constructs anOAuth2AuthenticationException
using the provided parameters.OAuth2AuthenticationException(OAuth2Error error, java.lang.Throwable cause)
Constructs anOAuth2AuthenticationException
using the provided parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OAuth2Error
getError()
Returns theOAuth 2.0 Error
.
-
-
-
Constructor Detail
-
OAuth2AuthenticationException
public OAuth2AuthenticationException(java.lang.String errorCode)
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
errorCode
- theOAuth 2.0 Error Code
- Since:
- 5.5
-
OAuth2AuthenticationException
public OAuth2AuthenticationException(OAuth2Error error)
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
-
OAuth2AuthenticationException
public OAuth2AuthenticationException(OAuth2Error error, java.lang.Throwable cause)
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
cause
- the root cause
-
OAuth2AuthenticationException
public OAuth2AuthenticationException(OAuth2Error error, java.lang.String message)
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
message
- the detail message
-
OAuth2AuthenticationException
public OAuth2AuthenticationException(OAuth2Error error, java.lang.String message, java.lang.Throwable cause)
Constructs anOAuth2AuthenticationException
using the provided parameters.- Parameters:
error
- theOAuth 2.0 Error
message
- the detail messagecause
- the root cause
-
-
Method Detail
-
getError
public OAuth2Error getError()
Returns theOAuth 2.0 Error
.- Returns:
- the
OAuth2Error
-
-