59 for (AuthenticationExecutionModel model : executions) {
61 if (factory == null) {
62 throw new AuthenticationFlowException(
"Could not find ClientAuthenticatorFactory for: " + model.getAuthenticator(), AuthenticationFlowError.INTERNAL_ERROR);
64 ClientAuthenticator authenticator = factory.create();
65 logger.debugv(
"client authenticator: {0}", factory.getId());
75 if (expectedClientAuthType == null) {
76 expectedClientAuthType = KeycloakModelUtils.getDefaultClientAuthenticatorType();
77 ServicesLogger.LOGGER.authMethodFallback(client.getClientId(), expectedClientAuthType);
81 if (factory.getId().equals(expectedClientAuthType)) {
83 if (response != null)
return response;
85 if (!context.getStatus().equals(FlowStatus.SUCCESS)) {
86 throw new AuthenticationFlowException(
"Expected success, but for an unknown reason the status was " + context.getStatus(), AuthenticationFlowError.INTERNAL_ERROR);
89 logger.debugv(
"Client {0} authenticated by {1}", client.getClientId(), factory.getId());
101 throw new AuthenticationFlowException(
"Invalid client credentials", AuthenticationFlowError.INVALID_CREDENTIALS);
AuthenticationProcessor.Result createClientAuthenticatorContext(AuthenticationExecutionModel model, ClientAuthenticator clientAuthenticator, List< AuthenticationExecutionModel > executions)
Definition: AuthenticationProcessor.java:1020
Response alternativeChallenge
Definition: ClientAuthenticationFlow.java:41
List< AuthenticationExecutionModel > findExecutionsToRun()
Definition: ClientAuthenticationFlow.java:104
KeycloakSessionFactory getKeycloakSessionFactory()
static final Logger logger
Definition: ClientAuthenticationFlow.java:39
KeycloakSession getSession()
Definition: AuthenticationProcessor.java:156
void error(String error)
Definition: EventBuilder.java:160
Response authenticateClient()
Definition: AuthenticationProcessor.java:784
AuthenticationProcessor processor
Definition: ClientAuthenticationFlow.java:42
EventBuilder detail(String key, String value)
Definition: EventBuilder.java:133
EventBuilder getEvent()
Definition: AuthenticationProcessor.java:235
< T extends Provider > ProviderFactory< T > getProviderFactory(Class< T > clazz)
String getClientAuthenticatorType()
ClientModel getClient()
Definition: AuthenticationProcessor.java:132
Response processResult(AuthenticationProcessor.Result result)
Definition: ClientAuthenticationFlow.java:130