Class AxelorApiKeyAuthenticator

java.lang.Object
com.axelor.auth.pac4j.local.AxelorApiKeyAuthenticator
All Implemented Interfaces:
org.pac4j.core.credentials.authenticator.Authenticator

public class AxelorApiKeyAuthenticator extends Object implements org.pac4j.core.credentials.authenticator.Authenticator
Authenticator implementation for API key-based authentication in Axelor.

This authenticator validates API key credentials

The authenticator performs the following validations:

  • Verifies the API key is present and has the correct format
  • Validates the token against the stored digest
  • Checks if the token has not expired
  • Confirms the associated user account is active

When authentication is successful, the authenticator updates the "last used" of the token and creates a user profile for the authenticated user.

  • Field Details

  • Constructor Details

    • AxelorApiKeyAuthenticator

      public AxelorApiKeyAuthenticator()
  • Method Details

    • validate

      public Optional<org.pac4j.core.credentials.Credentials> validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials credentials)
      Specified by:
      validate in interface org.pac4j.core.credentials.authenticator.Authenticator
    • setUserTokenLastUsed

      public void setUserTokenLastUsed(UserToken userToken)