Package org.keycloak.authentication
Interface ClientAuthenticatorFactory
- All Superinterfaces:
ConfigurableAuthenticatorFactory,ConfiguredPerClientProvider,ConfiguredProvider,ProviderFactory<ClientAuthenticator>
- All Known Implementing Classes:
AbstractClientAuthenticator,AttestationBasedClientAuthenticator,ClientIdAndSecretAuthenticator,FederatedJWTClientAuthenticator,JWTClientAuthenticator,JWTClientSecretAuthenticator,X509ClientAuthenticator
public interface ClientAuthenticatorFactory
extends ProviderFactory<ClientAuthenticator>, ConfigurableAuthenticatorFactory, ConfiguredPerClientProvider
Factory for creating ClientAuthenticator instances. This is a singleton and created when Keycloak boots.
You must specify a file
META-INF/services/org.keycloak.authentication.ClientAuthenticatorFactory in the jar that this class is contained in
This file must have the fully qualified class name of all your ClientAuthenticatorFactory classes
- Author:
- Marek Posolda
-
Field Summary
Fields inherited from interface org.keycloak.authentication.ConfigurableAuthenticatorFactory
COMMON_CONFIG_PROPERTIES, REQUIREMENT_CHOICES -
Method Summary
Modifier and TypeMethodDescriptioncreate()getAdapterConfiguration(KeycloakSession session, ClientModel client) Get configuration, which needs to be used for adapter ( keycloak.json ) of particular client.Declare all sensitive entries in the map returned bygetAdapterConfiguration(KeycloakSession, ClientModel).default StringGet protocol authentication method, which is set on the specified client.getProtocolAuthenticatorMethods(String loginProtocol) Get authentication methods for the specified protocolbooleanIs this authenticator configurable globally?default voidsetClientAuthenticationMethod(ClientRepresentation client, String protocolAuthMethod) Set specified client authentication method to the specified clientdefault booleanIs this authenticator supports authentication with client assertion?default booleanIs this authenticator supports client secret?Methods inherited from interface org.keycloak.authentication.ConfigurableAuthenticatorFactory
getDisplayType, getOptionalReferenceCategories, getReferenceCategory, getRequirementChoices, isUserSetupAllowedMethods inherited from interface org.keycloak.provider.ConfiguredPerClientProvider
getConfigPropertiesPerClientMethods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfig, getConfigProperties, getHelpTextMethods inherited from interface org.keycloak.provider.ProviderFactory
close, create, dependsOn, getConfigMetadata, getId, init, order, postInit
-
Method Details
-
create
ClientAuthenticator create() -
isConfigurable
boolean isConfigurable()Is this authenticator configurable globally?- Specified by:
isConfigurablein interfaceConfigurableAuthenticatorFactory- Returns:
-
getAdapterConfiguration
Get configuration, which needs to be used for adapter ( keycloak.json ) of particular client. Some implementations may return just template and user needs to edit the values according to his environment (For example fill the location of keystore file) Sensitive entries must be declared bygetAdapterConfigurationSecretKeys().- Returns:
-
getAdapterConfigurationSecretKeys
Declare all sensitive entries in the map returned bygetAdapterConfiguration(KeycloakSession, ClientModel). Paths are slash-separated map keys with a leading slash, for example/secretor/secret-jwt/secret. Keys must be non-empty and cannot contain slashes. No escaping is supported. Only nested maps can be traversed; array traversal is not supported. Missing paths are permitted for optional configuration entries. An entry declared sensitive is masked in its entirety, including when its value is a map or collection. Non-sensitive template placeholders need not be declared.- Returns:
- a non-null set of secret paths, or an empty set if the configuration contains no secrets
-
getProtocolAuthenticatorMethods
Get authentication methods for the specified protocol- Parameters:
loginProtocol- corresponds toProviderFactory.getId()- Returns:
- name of supported client authenticator methods in the protocol specific "language"
-
getProtocolAuthenticatorMethod
Get protocol authentication method, which is set on the specified client.- Parameters:
client- client whose authentication method will be returned- Returns:
- Client authentication method as specified in the related protocol specification. For example "client_secret_basic", "client_secret_post" or "private_key_jwt" might be used as returned values.
-
setClientAuthenticationMethod
Set specified client authentication method to the specified client- Parameters:
client- client to updateprotocolAuthMethod- Client authentication method as specified in the related protocol specification. For example "client_secret_basic", "client_secret_post" or "private_key_jwt" might be used as values of this parameter.
-
supportsSecret
default boolean supportsSecret()Is this authenticator supports client secret?- Returns:
- if it supports secret
-
supportsClientAssertion
default boolean supportsClientAssertion()Is this authenticator supports authentication with client assertion?- Returns:
- if it supports authentication with client assertion
-