| java.lang.Object org.mortbay.jetty.security.HashUserRealm
All known Subclasses: org.mortbay.jetty.security.JDBCUserRealm,
HashUserRealm | public class HashUserRealm implements UserRealm,SSORealm(Code) | | HashMapped 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.mortbay.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:.
The HashUserRealm also implements SSORealm but provides no implementation
of SSORealm. Instead setSSORealm may be used to provide a delegate
SSORealm implementation.
See Also: Password author: Greg Wilkins (gregw) |
Method Summary | |
public synchronized void | addUserToRole(String userName, String roleName) Add a user to a role. | public Principal | authenticate(String username, Object credentials, Request request) | public void | clearSingleSignOn(String username) | public void | disassociate(Principal user) | public void | dump(PrintStream out) | public String | getConfig() | public String | getName() The realm name. | public Principal | getPrincipal(String username) | public SSORealm | getSSORealm() | public Credential | getSingleSignOn(Request request, Response response) | public synchronized boolean | isUserInRole(Principal user, String roleName) Check if a user is in a role. | public void | logout(Principal user) | public Principal | popRole(Principal user) | public Principal | pushRole(Principal user, String role) | public synchronized Object | put(Object name, Object credentials) Put user into realm.
Parameters: name - User name Parameters: credentials - String password, Password or UserPrincipleinstance. | public boolean | reauthenticate(Principal user) | public void | setConfig(String config) Load realm users from properties file. | public void | setName(String name) | public void | setSSORealm(SSORealm ssoRealm) Set the SSORealm. | public void | setSingleSignOn(Request request, Response response, Principal principal, Credential credential) | public String | toString() |
__SSO | final public static String __SSO(Code) | | HttpContext Attribute to set to activate SSO.
|
HashUserRealm | public HashUserRealm()(Code) | | Constructor.
|
HashUserRealm | public HashUserRealm(String name)(Code) | | Constructor.
Parameters: name - Realm Name |
HashUserRealm | public HashUserRealm(String name, String config) throws IOException(Code) | | Constructor.
Parameters: name - Realm name Parameters: config - Filename or url of user properties file. |
addUserToRole | public synchronized void addUserToRole(String userName, String roleName)(Code) | | Add a user to a role.
Parameters: userName - Parameters: roleName - |
clearSingleSignOn | public void clearSingleSignOn(String username)(Code) | | |
getSSORealm | public SSORealm getSSORealm()(Code) | | The SSORealm to delegate single sign on requests to. |
isUserInRole | public synchronized boolean isUserInRole(Principal user, String roleName)(Code) | | Check if a user is in a role.
Parameters: user - The user, which must be from this realm Parameters: roleName - True if the user can act in the role. |
put | public synchronized Object put(Object name, Object credentials)(Code) | | Put user into realm.
Parameters: name - User name Parameters: credentials - String password, Password or UserPrincipleinstance. Old UserPrinciple value or null |
setConfig | public void setConfig(String config) throws IOException(Code) | | 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 - Filename or url of user properties file. exception: IOException - |
setName | public void setName(String name)(Code) | | Parameters: name - The realm name |
setSSORealm | public void setSSORealm(SSORealm ssoRealm)(Code) | | Set the SSORealm.
A SSORealm implementation may be set to enable support for SSO.
Parameters: ssoRealm - The SSORealm to delegate single sign on requests to. |
|
|