Class AcrStore
java.lang.Object
org.keycloak.authentication.authenticators.util.AcrStore
CRUD data in the authentication session, which are related to step-up authentication
- Author:
- Marek Posolda
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetCurrentLevelOfAuthentication(AuthenticatedClientSessionModel clientSession) intstatic intgetEffectiveLevelOfAuthentication(int level, boolean ssoAuthentication) Level reached by an authentication, shared by the enforcement of a requested level and by the ACR protocol mapper.intintreturn level, which was either: - directly authenticated in current authentication - or was already verified that can be re-used from previous authenticationintgetRequestedLevelOfAuthentication(AuthenticationFlowModel executionModel) booleanisLevelAuthenticatedInPreviousAuth(int level, int maxAge) booleanbooleanvoidSet the level assigned by the client policy flow selector to the current authentication session, if it is higher than the current level.voidsetLevelAuthenticated(int level) Save authenticated level to authenticationSession (for current authentication) and loa map (for future authentications)voidsetLevelAuthenticatedToCurrentRequest(int level) Set level to the current authentication session
-
Constructor Details
-
AcrStore
-
-
Method Details
-
isLevelOfAuthenticationForced
public boolean isLevelOfAuthenticationForced() -
getRequestedLevelOfAuthentication
-
isLevelOfAuthenticationSatisfiedFromCurrentAuthentication
public boolean isLevelOfAuthenticationSatisfiedFromCurrentAuthentication(AuthenticationFlowModel topFlow) - Returns:
- true if the current authentication reached the requested level, see
getEffectiveLevelOfAuthentication()
-
getEffectiveLevelOfAuthentication
public int getEffectiveLevelOfAuthentication()- Returns:
- the level reached by the current authentication, see
getEffectiveLevelOfAuthentication(int, boolean)
-
getEffectiveLevelOfAuthentication
public static int getEffectiveLevelOfAuthentication(int level, boolean ssoAuthentication) Level reached by an authentication, shared by the enforcement of a requested level and by the ACR protocol mapper. A recorded level wins. Without one, an active authentication isConstants.DEFAULT_AUTHENTICATED_LOAand an authentication satisfied solely by the SSO cookie isConstants.MINIMUM_LOA.- Parameters:
level- level recorded for the authentication,Constants.NO_LOAif nonessoAuthentication- true if the authentication was satisfied solely by the SSO cookie- Returns:
- the effective level, never lower than
Constants.MINIMUM_LOA
-
getCurrentLevelOfAuthentication
-
isLevelAuthenticatedInPreviousAuth
public boolean isLevelAuthenticatedInPreviousAuth(int level, int maxAge) - Parameters:
level- level of authenticationmaxAge- maxAge for which this level is considered valid- Returns:
- True if the particular level was already authenticated before in this userSession and is still valid
-
getLevelOfAuthenticationFromCurrentAuthentication
public int getLevelOfAuthenticationFromCurrentAuthentication()return level, which was either: - directly authenticated in current authentication - or was already verified that can be re-used from previous authentication- Returns:
- see above
-
setLevelAuthenticated
public void setLevelAuthenticated(int level) Save authenticated level to authenticationSession (for current authentication) and loa map (for future authentications)- Parameters:
level- level to save
-
setLevelAuthenticatedToCurrentRequest
public void setLevelAuthenticatedToCurrentRequest(int level) Set level to the current authentication session- Parameters:
level- , which was authenticated by user
-
setAuthFlowLevelAuthenticatedToCurrentRequest
Set the level assigned by the client policy flow selector to the current authentication session, if it is higher than the current level. It applies only when the completed flow is the flow the policy selected, so a registration or a reset credentials flow does not reach it.- Parameters:
completedFlow- top level flow which completed the authentication
-
getHighestAuthenticatedLevelFromPreviousAuthentication
- Returns:
- highest authenticated level from previous authentication, which is still valid (not yet expired)
-