Class SecondFactorRequiredException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.security.core.AuthenticationException
org.springframework.security.oauth2.core.OAuth2AuthenticationException
com.irurueta.authserver.authorization.api.web.mfa.SecondFactorRequiredException
- All Implemented Interfaces:
Serializable
public class SecondFactorRequiredException
extends org.springframework.security.oauth2.core.OAuth2AuthenticationException
Raised while an authorization request is validated when the user must present a second factor first. It is not a
failure to report to the client:
SecondFactorErrorResponseHandler sends the user to the second-factor page
instead. A step-up exception (forStepUp()) tells that the request asked for more than the sign-in policy,
so a remembered (trusted) device is not enough and the page must ask for a real second factor.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringError code of the exception.private static final longSerial version.private final booleanWhether the request asked for a step-up that a remembered device cannot satisfy. -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates the exception of a sign-in that does not satisfy the policy yet.privateSecondFactorRequiredException(boolean stepUp) Creates the exception. -
Method Summary
Modifier and TypeMethodDescriptionCreates the exception of a step-up request (acr_values) that needs a real second factor.booleanisStepUp()Tells whether the request asked for a step-up that a remembered device cannot satisfy.Methods inherited from class org.springframework.security.oauth2.core.OAuth2AuthenticationException
getErrorMethods inherited from class org.springframework.security.core.AuthenticationException
getAuthenticationRequest, setAuthenticationRequestMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
ERROR_CODE
Error code of the exception.- See Also:
-
serialVersionUID
private static final long serialVersionUIDSerial version.- See Also:
-
stepUp
private final boolean stepUpWhether the request asked for a step-up that a remembered device cannot satisfy.
-
-
Constructor Details
-
SecondFactorRequiredException
public SecondFactorRequiredException()Creates the exception of a sign-in that does not satisfy the policy yet. -
SecondFactorRequiredException
private SecondFactorRequiredException(boolean stepUp) Creates the exception.- Parameters:
stepUp- whether the request asked for a step-up that a remembered device cannot satisfy.
-
-
Method Details
-
forStepUp
Creates the exception of a step-up request (acr_values) that needs a real second factor.- Returns:
- the exception.
-
isStepUp
public boolean isStepUp()Tells whether the request asked for a step-up that a remembered device cannot satisfy.- Returns:
truefor a step-up.
-