Class JWTClientAuthenticator
java.lang.Object
org.keycloak.authentication.authenticators.client.AbstractClientAuthenticator
org.keycloak.authentication.authenticators.client.JWTClientAuthenticator
- All Implemented Interfaces:
ClientAuthenticator,ClientAuthenticatorFactory,ConfigurableAuthenticatorFactory,ConfiguredPerClientProvider,ConfiguredProvider,Provider,ProviderFactory<ClientAuthenticator>
Client authentication based on JWT signed by client private key .
See specs for more details.
This is server side, which verifies JWT from client_assertion parameter, where the assertion was created on adapter side by
org.keycloak.adapters.authentication.JWTClientCredentialsProvider
- Author:
- Marek Posolda
-
Field Summary
FieldsFields inherited from class org.keycloak.authentication.authenticators.client.AbstractClientAuthenticator
loggerFields inherited from interface org.keycloak.authentication.ConfigurableAuthenticatorFactory
COMMON_CONFIG_PROPERTIES, REQUIREMENT_CHOICES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidInitial call for the authenticator.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 byClientAuthenticatorFactory.getAdapterConfiguration(KeycloakSession, ClientModel).List of config properties for this client implementation.Friendly name for the authenticatorgetId()getProtocolAuthenticatorMethods(String loginProtocol) Get authentication methods for the specified protocolWhat requirement settings are allowed.protected PublicKeygetSignatureValidationKey(ClientModel client, ClientAuthenticationFlowContext context, JWSInput jws) booleanIs this authenticator configurable globally?booleanIs this authenticator supports authentication with client assertion?booleanverifySignature(AbstractJWTClientValidator validator) Methods inherited from class org.keycloak.authentication.authenticators.client.AbstractClientAuthenticator
close, create, create, getReferenceCategory, init, isUserSetupAllowed, postInitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.authentication.ClientAuthenticatorFactory
getProtocolAuthenticatorMethod, setClientAuthenticationMethod, supportsSecretMethods inherited from interface org.keycloak.authentication.ConfigurableAuthenticatorFactory
getOptionalReferenceCategoriesMethods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfigMethods inherited from interface org.keycloak.provider.ProviderFactory
dependsOn, getConfigMetadata, order
-
Field Details
-
PROVIDER_ID
- See Also:
-
ATTR_PREFIX
- See Also:
-
CERTIFICATE_ATTR
- See Also:
-
-
Constructor Details
-
JWTClientAuthenticator
public JWTClientAuthenticator()
-
-
Method Details
-
authenticateClient
Description copied from interface:ClientAuthenticatorInitial call for the authenticator. This method should check the current HTTP request to determine if the request satisfies the ClientAuthenticator's requirements. If it doesn't, it should send back a challenge response by calling the ClientAuthenticationFlowContext.challenge(Response). -
verifySignature
-
getSignatureValidationKey
protected PublicKey getSignatureValidationKey(ClientModel client, ClientAuthenticationFlowContext context, JWSInput jws) -
getDisplayType
Description copied from interface:ConfigurableAuthenticatorFactoryFriendly name for the authenticator- Returns:
-
isConfigurable
public boolean isConfigurable()Description copied from interface:ClientAuthenticatorFactoryIs this authenticator configurable globally?- Returns:
-
getRequirementChoices
Description copied from interface:ConfigurableAuthenticatorFactoryWhat requirement settings are allowed.- Returns:
-
getHelpText
-
getConfigProperties
-
getConfigPropertiesPerClient
Description copied from interface:ConfiguredPerClientProviderList of config properties for this client implementation. Those will be shown in admin console in clients credentials tab and can be configured per client.- Returns:
-
getAdapterConfiguration
Description copied from interface:ClientAuthenticatorFactoryGet 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 byClientAuthenticatorFactory.getAdapterConfigurationSecretKeys().- Returns:
-
getAdapterConfigurationSecretKeys
Description copied from interface:ClientAuthenticatorFactoryDeclare all sensitive entries in the map returned byClientAuthenticatorFactory.getAdapterConfiguration(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
-
getId
-
supportsClientAssertion
public boolean supportsClientAssertion()Description copied from interface:ClientAuthenticatorFactoryIs this authenticator supports authentication with client assertion?- Returns:
- if it supports authentication with client assertion
-
getProtocolAuthenticatorMethods
Description copied from interface:ClientAuthenticatorFactoryGet authentication methods for the specified protocol- Parameters:
loginProtocol- corresponds toProviderFactory.getId()- Returns:
- name of supported client authenticator methods in the protocol specific "language"
-