Package com.axelor.auth.pac4j.local
Class AxelorAuthenticator
java.lang.Object
com.axelor.auth.pac4j.local.AxelorAuthenticator
- All Implemented Interfaces:
org.pac4j.core.credentials.authenticator.Authenticator
public class AxelorAuthenticator
extends Object
implements org.pac4j.core.credentials.authenticator.Authenticator
Authenticator implementation for local username/password authentication.
This is the default authenticator used by the form and basic auth clients. It may also be
called outside the Pac4j flow, in which case the CallContext is null.
It also drives the password change flow: a user flagged with force password change must submit a new password, and a submitted new password is stored only after it passes the password policies.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.pac4j.core.credentials.authenticator.Authenticator
ALWAYS_VALIDATE, NEVER_VALIDATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.pac4j.core.credentials.Credentials> validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials inputCredentials) protected UservalidateUser(String username, String password, boolean passwordChangeRequest) Finds the user matching the given credentials.
-
Field Details
-
INCORRECT_CREDENTIALS
- See Also:
-
NO_CREDENTIALS
- See Also:
-
UNSUPPORTED_CREDENTIALS
- See Also:
-
INCOMPLETE_CREDENTIALS
- See Also:
-
UNKNOWN_USER
- See Also:
-
USER_DISABLED
- See Also:
-
WRONG_CURRENT_PASSWORD
- See Also:
-
-
Constructor Details
-
AxelorAuthenticator
public AxelorAuthenticator()
-
-
Method Details
-
validate
public Optional<org.pac4j.core.credentials.Credentials> validate(org.pac4j.core.context.CallContext ctx, org.pac4j.core.credentials.Credentials inputCredentials) - Specified by:
validatein interfaceorg.pac4j.core.credentials.authenticator.Authenticator
-
validateUser
Finds the user matching the given credentials.- Parameters:
username- the usernamepassword- the current passwordpasswordChangeRequest- whether the user is changing their password- Returns:
- the matching active user
- Throws:
org.pac4j.core.exception.CredentialsException- if the credentials are incomplete or don't match an active user
-