public class HashLoginServiceFactory extends java.lang.Object implements JettyLoginServiceFactory
HashLoginService
for use with Jetty.
This simply exposes the Jetty HashLoginService as Interlok configuration. The documentation from the eclipse jetty site should always be considered canonical. The HashLoginService is a realm whose authentication and authorization information is stored in a properties file. Each line in the file contains a username, a password, and zero or more role assignments. The format is
username: password[,rolename ...]
username: password[,rolename ...]
where:
If you need to secure the passwords in your properties file then you can follow the
jetty documentation to obfuscate/hash the password. Note that the CRYPT
style is
based on Unix Crypt which is considered weak and insecure (you probably shouldn't be using it).
$ java -cp ./lib/jetty-util.jar org.eclipse.jetty.util.security.Password myusername MySuperSecretPassword
OBF:1o4o1zly1rhf1zst1y0s1vu91uvk1ldu1w1c1sot1y7z1sox1w261ldo1uum1vv11y0y1zsx1riz1zlk1o5y
MD5:d418c3e96fb98e73fd603a8b6134edda
CRYPT:my8hdCDBVkNU.
Constructor and Description |
---|
HashLoginServiceFactory() |
HashLoginServiceFactory(java.lang.String realm,
java.lang.String filename) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFilename() |
java.lang.Integer |
getRefreshInterval()
Deprecated.
since 3.6.0 refresh interval has no effect.
|
java.lang.String |
getUserRealm() |
org.eclipse.jetty.security.LoginService |
retrieveLoginService() |
void |
setFilename(java.lang.String filename)
Set the filename containing the username/password/roles.
|
void |
setRefreshInterval(java.lang.Integer i)
Deprecated.
since 3.6.0 refresh interval has no effect.
|
void |
setUserRealm(java.lang.String userRealm) |
public HashLoginServiceFactory()
public HashLoginServiceFactory(java.lang.String realm, java.lang.String filename)
public org.eclipse.jetty.security.LoginService retrieveLoginService()
retrieveLoginService
in interface JettyLoginServiceFactory
public java.lang.String getUserRealm()
public void setUserRealm(java.lang.String userRealm)
public java.lang.String getFilename()
public void setFilename(java.lang.String filename)
filename
- the filename.@Deprecated @Removal(version="3.9.0") public java.lang.Integer getRefreshInterval()
@Deprecated @Removal(version="3.9.0") public void setRefreshInterval(java.lang.Integer i)
i
- the refreshInterval to set