Package com.axelor.auth.pac4j.local
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE, NEVER_VALIDATE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
setUserTokenLastUsed
(UserToken userToken) Optional
<org.pac4j.core.credentials.Credentials> validate
(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials credentials)
-
Field Details
-
UNSUPPORTED_CREDENTIALS
- See Also:
-
MISSING_API_KEY
- See Also:
-
INVALID_API_KEY
- See Also:
-
USER_DISABLED
- See Also:
-
-
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 interfaceorg.pac4j.core.credentials.authenticator.Authenticator
-
setUserTokenLastUsed
-