126 logger.debug(
"processFlow");
129 logger.debugv(
"check execution: {0} requirement: {1}", model.getAuthenticator(), model.getRequirement().toString());
132 logger.debug(
"execution is processed");
138 logger.debug(
"Skip alternative execution");
142 if (model.isAuthenticatorFlow()) {
143 logger.debug(
"execution is flow");
146 Response flowChallenge = null;
149 }
catch (AuthenticationFlowException afe) {
150 if (model.isAlternative()) {
151 logger.debug(
"Thrown exception in alternative Subflow. Ignoring Subflow");
159 if (flowChallenge == null) {
164 if (model.isAlternative()) {
167 }
else if (model.isRequired()) {
169 return flowChallenge;
170 }
else if (model.isOptional()) {
177 return flowChallenge;
182 if (factory == null) {
183 throw new RuntimeException(
"Unable to find factory for AuthenticatorFactory: " + model.getAuthenticator() +
" did you forget to declare it in a META-INF/services file?");
186 logger.debugv(
"authenticator: {0}", factory.getId());
189 if (authenticator.requiresUser() && authUser == null) {
194 throw new AuthenticationFlowException(
"authenticator: " + factory.getId(), AuthenticationFlowError.UNKNOWN_USER);
196 boolean configuredFor =
false;
197 if (authenticator.requiresUser() && authUser != null) {
199 if (!configuredFor) {
200 if (model.isRequired()) {
201 if (factory.isUserSetupAllowed()) {
202 logger.debugv(
"authenticator SETUP_REQUIRED: {0}", factory.getId());
207 throw new AuthenticationFlowException(AuthenticationFlowError.CREDENTIAL_SETUP_REQUIRED);
209 }
else if (model.isOptional()) {
220 logger.debugv(
"invoke authenticator.authenticate: {0}", factory.getId());
221 authenticator.authenticate(context);
223 if (response != null)
return response;
Iterator< AuthenticationExecutionModel > executionIterator
Definition: DefaultAuthenticationFlow.java:42
Authenticator createAuthenticator(AuthenticatorFactory factory)
Definition: DefaultAuthenticationFlow.java:62
KeycloakSessionFactory getKeycloakSessionFactory()
KeycloakSession getSession()
Definition: AuthenticationProcessor.java:156
AuthenticationExecutionModel challengedAlternativeExecution
Definition: DefaultAuthenticationFlow.java:39
AuthenticationSessionModel getAuthenticationSession()
Definition: AuthenticationProcessor.java:144
List< AuthenticationExecutionModel > executions
Definition: DefaultAuthenticationFlow.java:41
UserModel getAuthenticatedUser()
void setExecutionStatus(String authenticator, ExecutionStatus status)
AuthenticationProcessor.Result createAuthenticatorContext(AuthenticationExecutionModel model, Authenticator authenticator, List< AuthenticationExecutionModel > executions)
Definition: AuthenticationProcessor.java:1016
AuthenticationProcessor processor
Definition: DefaultAuthenticationFlow.java:43
Response alternativeChallenge
Definition: DefaultAuthenticationFlow.java:38
static final Logger logger
Definition: DefaultAuthenticationFlow.java:37
RealmModel getRealm()
Definition: AuthenticationProcessor.java:128
Response processResult(AuthenticationProcessor.Result result, boolean isAction)
Definition: DefaultAuthenticationFlow.java:229
boolean isProcessed(AuthenticationExecutionModel model)
Definition: DefaultAuthenticationFlow.java:53
AuthenticationFlow createFlowExecution(String flowId, AuthenticationExecutionModel execution)
Definition: AuthenticationProcessor.java:757
String getId()
Definition: AuthenticationExecutionModel.java:47
boolean isSuccessful(AuthenticationExecutionModel model)
Definition: AuthenticationProcessor.java:650
< T extends Provider > ProviderFactory< T > getProviderFactory(Class< T > clazz)
boolean alternativeSuccessful
Definition: DefaultAuthenticationFlow.java:40