Interface CredentialsValidator


@ConsumerType public interface CredentialsValidator

This interface is intended to be implemented by an application which wants to customize the validation of the users based on their credential.

A CredentialsValidator is passed to Provider providers if Provider.getId() equals getId() or getId() is equals to ALL_ID-

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Id used to register a validator to all providers
    static final String
    Credentials Attribute Id used to store the reason why it is not considered valid
  • Method Summary

    Modifier and Type
    Method
    Description
    Provider identifier used to map this credential validator to it.
    boolean
    Check the validity of a user credential.
  • Field Details

    • ALL_ID

      static final String ALL_ID
      Id used to register a validator to all providers
      See Also:
    • FAILED_VALIDATION_REASON

      static final String FAILED_VALIDATION_REASON
      Credentials Attribute Id used to store the reason why it is not considered valid
  • Method Details

    • validate

      boolean validate(AbstractCredentials credentials) throws LoginException
      Check the validity of a user credential. If the user credential is not valid, an optional credential attribute is stored with key @{code
      Parameters:
      credentials - the non null credential
      Returns:
      true if the credential is valid ; false otherwise
      Throws:
      LoginException - if the user could not be authenticated
    • getId

      String getId()
      Provider identifier used to map this credential validator to it.
      Returns:
      the provider identifier to map this credentials validator to it or ALL_ID if applies to every provider.