Interface AuthenticationService<T,U>

Type Parameters:
T - the credentials type (e.g. a username/password record)
U - the subject (user) type

public interface AuthenticationService<T,U>
SPI contract for credential validation and subject loading.

Implementations must be registered in META-INF/services/com.svenruppert.jsentinel.authentication.AuthenticationService.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkCredentials(T credentials)
    Validates the given credentials.
    loadSubject(T credentials)
    Loads the subject for the given (already validated) credentials.
    Returns the class token for the subject type.
  • Method Details

    • checkCredentials

      boolean checkCredentials(T credentials)
      Validates the given credentials.
      Parameters:
      credentials - the credentials to check
      Returns:
      true if the credentials are valid
    • loadSubject

      U loadSubject(T credentials)
      Loads the subject for the given (already validated) credentials.
      Parameters:
      credentials - the validated credentials
      Returns:
      the authenticated subject
    • subjectType

      Class<U> subjectType()
      Returns the class token for the subject type. Used by SubjectStore implementations to store and retrieve the subject.
      Returns:
      the subject class