Search in sources :

Example 1 with ConditionalAuthenticator

use of org.keycloak.authentication.authenticators.conditional.ConditionalAuthenticator in project keycloak by keycloak.

the class DefaultAuthenticationFlow method conditionalNotMatched.

private boolean conditionalNotMatched(AuthenticationExecutionModel model, List<AuthenticationExecutionModel> executionList) {
    AuthenticatorFactory factory = getAuthenticatorFactory(model);
    ConditionalAuthenticator authenticator = (ConditionalAuthenticator) createAuthenticator(factory);
    AuthenticationProcessor.Result context = processor.createAuthenticatorContext(model, authenticator, executionList);
    // Always store result for future re-evaluation. It is a chance that some condition is evaluated multiple times during the flow,
    // but this is expected as "conditions of condition" can be changed during the flow (EG. when acr level is reached or when user is added to the context)
    boolean matchCondition = authenticator.matchCondition(context);
    setExecutionStatus(model, matchCondition ? AuthenticationSessionModel.ExecutionStatus.EVALUATED_TRUE : AuthenticationSessionModel.ExecutionStatus.EVALUATED_FALSE);
    return !matchCondition;
}
Also used : ConditionalAuthenticator(org.keycloak.authentication.authenticators.conditional.ConditionalAuthenticator)

Aggregations

ConditionalAuthenticator (org.keycloak.authentication.authenticators.conditional.ConditionalAuthenticator)1