Class AbstractLoginService

All Implemented Interfaces:
LoginService, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
Direct Known Subclasses:
DataSourceLoginService, HashLoginService, JDBCLoginService

public abstract class AbstractLoginService extends ContainerLifeCycle implements LoginService
AbstractLoginService Base class for LoginServices that allows subclasses to provide the user authentication and authorization information, but provides common behaviour such as handling authentication.
  • Field Details

    • _identityService

      protected IdentityService _identityService
    • _name

      protected String _name
    • _fullValidate

      protected boolean _fullValidate
  • Constructor Details

    • AbstractLoginService

      protected AbstractLoginService()
  • Method Details

    • loadRoleInfo

      protected abstract List<RolePrincipal> loadRoleInfo(UserPrincipal user)
    • loadUserInfo

      protected abstract UserPrincipal loadUserInfo(String username)
    • getName

      public String getName()
      Specified by:
      getName in interface LoginService
      Returns:
      Get the name of the login service (aka Realm name)
    • setIdentityService

      public void setIdentityService(IdentityService identityService)
      Set the identityService.
      Specified by:
      setIdentityService in interface LoginService
      Parameters:
      identityService - the identityService to set
    • setName

      public void setName(String name)
      Set the name.
      Parameters:
      name - the name to set
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLifeCycle
    • login

      public UserIdentity login(String username, Object credentials, Request request, Function<Boolean,Session> getOrCreateSession)
      Description copied from interface: LoginService
      Login a user.
      Specified by:
      login in interface LoginService
      Parameters:
      username - The username.
      credentials - The users credentials.
      request - The request or null
      getOrCreateSession - function to retrieve or create a session.
      Returns:
      A UserIdentity if the credentials matched, otherwise null
    • validate

      public boolean validate(UserIdentity user)
      Description copied from interface: LoginService
      Validate a user identity. Validate that a UserIdentity previously created by a call to LoginService.login(String, Object, Request, Function) is still valid.
      Specified by:
      validate in interface LoginService
      Parameters:
      user - The user to validate
      Returns:
      true if authentication has not been revoked for the user.
    • getIdentityService

      public IdentityService getIdentityService()
      Description copied from interface: LoginService
      Get the IdentityService associated with this Login Service.
      Specified by:
      getIdentityService in interface LoginService
      Returns:
      the IdentityService associated with this Login Service.
    • logout

      public void logout(UserIdentity user)
      Specified by:
      logout in interface LoginService
    • isFullValidate

      public boolean isFullValidate()
    • setFullValidate

      public void setFullValidate(boolean fullValidate)