public final class TerminateAuthenticationChainException
extends org.springframework.security.authentication.AccountStatusException
This exception could be thrown by an AuthenticationProvider
to stop authenticating against other available AuthenticationProvider
s and
immediately fail authentication.
To instantiate this exception, one must provide an AuthenticationException
as the
cause, which will then be handled appropriately by the framework.
For instance, if an AuthenticationProvider
decides to terminate the chain of
authentication against all the available AuthenticationProvider
s due to failed
authentication, it can throw a new TerminateAuthenticationChainException
with
BadCredentialsException
as the cause. Following is a sample code snippet to do so:
AuthenticationException cause = new BadCredentialsException("invalid credentials"); throw new TerminateAuthenticationChainException(cause);
BadCredentialsException
,
LockedException
,
TemporaryCredentialsExpiredException
,
AuthenticationException
,
Serialized FormConstructor and Description |
---|
TerminateAuthenticationChainException(org.springframework.security.core.AuthenticationException cause) |
Modifier and Type | Method and Description |
---|---|
org.springframework.security.core.AuthenticationException |
getCause() |
public TerminateAuthenticationChainException(org.springframework.security.core.AuthenticationException cause)
cause
- an AuthenticationException
java.lang.NullPointerException
- this exception will be thrown if the cause is nullCopyright © 2003-2024 Appian Corporation. All Rights Reserved.