Package org.eclipse.jetty.security
Class HashLoginService
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.security.AbstractLoginService
-
- org.eclipse.jetty.security.HashLoginService
-
- All Implemented Interfaces:
LoginService,org.eclipse.jetty.util.component.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:.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.jetty.security.AbstractLoginService
AbstractLoginService.RolePrincipal, AbstractLoginService.UserPrincipal
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.security.AbstractLoginService
_fullValidate, _identityService, _name
-
-
Constructor Summary
Constructors Constructor Description HashLoginService()HashLoginService(java.lang.String name)HashLoginService(java.lang.String name, java.lang.String config)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voiddoStart()protected voiddoStop()java.lang.StringgetConfig()org.eclipse.jetty.util.resource.ResourcegetConfigResource()Deprecated.booleanisHotReload()Is hot reload enabled on this user storeprotected java.lang.String[]loadRoleInfo(AbstractLoginService.UserPrincipal user)protected AbstractLoginService.UserPrincipalloadUserInfo(java.lang.String userName)voidsetConfig(java.lang.String config)Load realm users from properties file.voidsetHotReload(boolean enable)Enable Hot Reload of the Property FilevoidsetUserStore(UserStore userStore)Configure theUserStoreimplementation to use.-
Methods inherited from class org.eclipse.jetty.security.AbstractLoginService
getIdentityService, getName, isFullValidate, login, logout, setFullValidate, setIdentityService, setName, toString, validate
-
-
-
-
Method Detail
-
getConfig
public java.lang.String getConfig()
-
getConfigResource
@Deprecated public org.eclipse.jetty.util.resource.Resource getConfigResource()
Deprecated.
-
setConfig
public void setConfig(java.lang.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 theUserStoreimplementation to use. If none, for backward compat if none thePropertyUserStorewill be used- Parameters:
userStore- theUserStoreimplementation to use
-
loadRoleInfo
protected java.lang.String[] loadRoleInfo(AbstractLoginService.UserPrincipal user)
- Specified by:
loadRoleInfoin classAbstractLoginService
-
loadUserInfo
protected AbstractLoginService.UserPrincipal loadUserInfo(java.lang.String userName)
- Specified by:
loadUserInfoin classAbstractLoginService
-
doStart
protected void doStart() throws java.lang.Exception- Overrides:
doStartin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
java.lang.Exception- See Also:
AbstractLifeCycle.doStart()
-
doStop
protected void doStop() throws java.lang.Exception- Overrides:
doStopin classorg.eclipse.jetty.util.component.AbstractLifeCycle- Throws:
java.lang.Exception- See Also:
AbstractLifeCycle.doStop()
-
-