Class AuthenticationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.core.AuthenticationException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AccountStatusException
,ActiveDirectoryAuthenticationException
,AuthenticationCredentialsNotFoundException
,AuthenticationServiceException
,BadCredentialsException
,CompromisedPasswordException
,InsufficientAuthenticationException
,InvalidOneTimeTokenException
,NonceExpiredException
,OAuth2AuthenticationException
,PreAuthenticatedCredentialsNotFoundException
,ProviderNotFoundException
,RememberMeAuthenticationException
,Saml2AuthenticationException
,SessionAuthenticationException
,UsernameNotFoundException
Abstract superclass for all exceptions related to an
Authentication
object
being invalid for whatever reason.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anAuthenticationException
with the specified message and no root cause.AuthenticationException
(String msg, Throwable cause) Constructs anAuthenticationException
with the specified message and root cause. -
Method Summary
Modifier and TypeMethodDescriptionGet theAuthentication
object representing the failed authentication attempt.void
setAuthenticationRequest
(Authentication authenticationRequest) Set theAuthentication
object representing the failed authentication attempt.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AuthenticationException
Constructs anAuthenticationException
with the specified message and root cause.- Parameters:
msg
- the detail messagecause
- the root cause
-
AuthenticationException
Constructs anAuthenticationException
with the specified message and no root cause.- Parameters:
msg
- the detail message
-
-
Method Details
-
getAuthenticationRequest
Get theAuthentication
object representing the failed authentication attempt.This field captures the authentication request that was attempted but ultimately failed, providing critical information for diagnosing the failure and facilitating debugging
- Since:
- 6.5
-
setAuthenticationRequest
Set theAuthentication
object representing the failed authentication attempt.The provided
authenticationRequest
should not be null- Parameters:
authenticationRequest
- the authentication request associated with the failed authentication attempt- Since:
- 6.5
-