Class HashLoginService

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

public class HashLoginService extends AbstractLoginService
Properties User Realm.

An implementation of UserRealm that stores users and roles in-memory in HashMaps.

Typically these maps are populated by calling the load() method or passing a properties resource to the constructor. The format of the properties file is:

  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:.

  • Field Details

    • LOG

      private static final Logger LOG
    • _config

      private String _config
    • hotReload

      private boolean hotReload
    • _userStore

      private UserStore _userStore
    • _userStoreAutoCreate

      private boolean _userStoreAutoCreate
  • Constructor Details

    • HashLoginService

      public HashLoginService()
    • HashLoginService

      public HashLoginService(String name)
    • HashLoginService

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

    • getConfig

      public String getConfig()
    • getConfigResource

      @Deprecated public Resource getConfigResource()
      Deprecated.
    • setConfig

      public void setConfig(String config)
      Load realm 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

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

      public void setHotReload(boolean enable)
      Enable Hot Reload of the Property File
      Parameters:
      enable - true to enable, false to disable
    • 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 String[] loadRoleInfo(AbstractLoginService.UserPrincipal user)
      Specified by:
      loadRoleInfo in class AbstractLoginService
    • loadUserInfo

      protected AbstractLoginService.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:
      Exception
      See Also:
    • getUserStore

      UserStore getUserStore()
      To facilitate testing.
      Returns:
      the UserStore
    • isUserStoreAutoCreate

      boolean isUserStoreAutoCreate()
      To facilitate testing.
      Returns:
      true if a UserStore has been created from a config, false if a UserStore was provided.
    • 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
      See Also: