Class HashLoginService

All Implemented Interfaces:
LoginService, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle

public class HashLoginService extends AbstractLoginService
An implementation of a LoginService that stores users and roles in-memory in HashMaps. The source of the users and roles information is a properties file formatted like so:
  username: password [,rolename ...]
 
Passwords may be clear text, obfuscated or checksummed. The class com.eclipse.Util.Password should be used to generate obfuscated passwords or password checksums.

If DIGEST Authentication is used, the password must be in a recoverable format, either plain text or OBF:.

  • Constructor Details

    • HashLoginService

      public HashLoginService()
    • HashLoginService

      public HashLoginService(String name)
    • HashLoginService

      public HashLoginService(String name, Resource config)
  • Method Details

    • getConfig

      public Resource getConfig()
    • setConfig

      public void setConfig(Resource config)
      Load users from properties file.

      The property file maps usernames to password specs followed by an optional comma separated list of role names.

      Parameters:
      config - uri or url or path to realm properties file
    • isHotReload

      @Deprecated public boolean isHotReload()
      Deprecated.
      Is hot reload enabled on this user store
      Returns:
      true if hot reload was enabled before startup
    • setHotReload

      @Deprecated public void setHotReload(boolean enable)
      Deprecated.
      Enable Hot Reload of the Property File
      Parameters:
      enable - true to enable 1s refresh interval, false to disable
    • getReloadInterval

      public int getReloadInterval()
      Get the scan interval in seconds for reloading the property file..
      Returns:
      the scan interval in seconds for reloading the property file.
    • setReloadInterval

      public void setReloadInterval(int reloadIntervalSeconds)
      Parameters:
      reloadIntervalSeconds - Set the scan interval in seconds for reloading the property file.
    • setUserStore

      public void setUserStore(UserStore userStore)
      Configure the UserStore implementation to use. If none, for backward compat if none the PropertyUserStore will be used
      Parameters:
      userStore - the UserStore implementation to use
    • loadRoleInfo

      protected List<RolePrincipal> loadRoleInfo(UserPrincipal user)
      Specified by:
      loadRoleInfo in class AbstractLoginService
    • loadUserInfo

      protected UserPrincipal loadUserInfo(String userName)
      Specified by:
      loadUserInfo in class AbstractLoginService
    • doStart

      protected void doStart() throws Exception
      Description copied from class: ContainerLifeCycle
      Starts the managed lifecycle beans in the order they were added.
      Overrides:
      doStart in class ContainerLifeCycle
      Throws:
      AbstractLifeCycle.StopException - If thrown, the lifecycle will immediately be stopped.
      Exception - If there was a problem starting. Will cause a transition to FAILED state
    • doStop

      protected void doStop() throws Exception
      Description copied from class: ContainerLifeCycle
      Stops the managed lifecycle beans in the reverse order they were added.
      Overrides:
      doStop in class ContainerLifeCycle
      Throws:
      Exception - If there was a problem stopping. Will cause a transition to FAILED state