Interface AuthenticationProvider

All Known Subinterfaces:
UserRegistry

@NonNullByDefault public interface AuthenticationProvider
Realizations of this type are responsible for checking validity of various credentials and giving back authentication which defines access scope for authenticated user or system.
Author:
Ɓukasz Dywicki - Initial contribution
  • Method Summary

    Modifier and Type
    Method
    Description
    Verify given credentials and give back authentication if they are valid.
    boolean
    supports(Class<? extends Credentials> type)
    Additional method to verify if given authentication provider can handle given type of credentials.
  • Method Details

    • authenticate

      Authentication authenticate(Credentials credentials) throws AuthenticationException
      Verify given credentials and give back authentication if they are valid.
      Parameters:
      credentials - User credentials.
      Returns:
      null if credentials were not valid for this provider
      Throws:
      AuthenticationException - if authentication failed due to credentials mismatch.
    • supports

      boolean supports(Class<? extends Credentials> type)
      Additional method to verify if given authentication provider can handle given type of credentials.
      Parameters:
      type - Type of credentials.
      Returns:
      True if credentials of given type can be used for authentication attempt with provider.