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>

public class JWTClientAuthenticator extends AbstractClientAuthenticator
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 Details

  • Constructor Details

    • JWTClientAuthenticator

      public JWTClientAuthenticator()
  • Method Details

    • authenticateClient

      public void authenticateClient(ClientAuthenticationFlowContext context)
      Description copied from interface: ClientAuthenticator
      Initial 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

      public boolean verifySignature(AbstractJWTClientValidator validator)
    • getSignatureValidationKey

      protected PublicKey getSignatureValidationKey(ClientModel client, ClientAuthenticationFlowContext context, JWSInput jws)
    • getDisplayType

      public String getDisplayType()
      Description copied from interface: ConfigurableAuthenticatorFactory
      Friendly name for the authenticator
      Returns:
    • isConfigurable

      public boolean isConfigurable()
      Description copied from interface: ClientAuthenticatorFactory
      Is this authenticator configurable globally?
      Returns:
    • getRequirementChoices

      public AuthenticationExecutionModel.Requirement[] getRequirementChoices()
      Description copied from interface: ConfigurableAuthenticatorFactory
      What requirement settings are allowed.
      Returns:
    • getHelpText

      public String getHelpText()
    • getConfigProperties

      public List<ProviderConfigProperty> getConfigProperties()
    • getConfigPropertiesPerClient

      public List<ProviderConfigProperty> getConfigPropertiesPerClient()
      Description copied from interface: ConfiguredPerClientProvider
      List 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

      public Map<String,Object> getAdapterConfiguration(KeycloakSession session, ClientModel client)
      Description copied from interface: ClientAuthenticatorFactory
      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 by ClientAuthenticatorFactory.getAdapterConfigurationSecretKeys().
      Returns:
    • getAdapterConfigurationSecretKeys

      public Set<String> getAdapterConfigurationSecretKeys()
      Description copied from interface: ClientAuthenticatorFactory
      Declare all sensitive entries in the map returned by ClientAuthenticatorFactory.getAdapterConfiguration(KeycloakSession, ClientModel). Paths are slash-separated map keys with a leading slash, for example /secret or /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

      public String getId()
    • supportsClientAssertion

      public boolean supportsClientAssertion()
      Description copied from interface: ClientAuthenticatorFactory
      Is this authenticator supports authentication with client assertion?
      Returns:
      if it supports authentication with client assertion
    • getProtocolAuthenticatorMethods

      public Set<String> getProtocolAuthenticatorMethods(String loginProtocol)
      Description copied from interface: ClientAuthenticatorFactory
      Get authentication methods for the specified protocol
      Parameters:
      loginProtocol - corresponds to ProviderFactory.getId()
      Returns:
      name of supported client authenticator methods in the protocol specific "language"