org.mortbay.http
public class HashUserRealm extends HashMap implements UserRealm, SSORealm, Externalizable
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.
Version: $Id: HashUserRealm.java,v 1.29 2005/08/13 00:01:24 gregwilkins Exp $
See Also: Password
Field Summary | |
---|---|
protected HashMap | _roles |
static String | __SSO HttpContext Attribute to set to activate SSO. |
Constructor Summary | |
---|---|
HashUserRealm() Constructor. | |
HashUserRealm(String name) Constructor. | |
HashUserRealm(String name, String config) Constructor. |
Method Summary | |
---|---|
void | addUserToRole(String userName, String roleName) Add a user to a role. |
Principal | authenticate(String username, Object credentials, HttpRequest request) |
void | clearSingleSignOn(String username) |
void | disassociate(Principal user) |
void | dump(PrintStream out) |
String | getName() |
Principal | getPrincipal(String username) |
Credential | getSingleSignOn(HttpRequest request, HttpResponse response) |
SSORealm | getSSORealm() |
boolean | isUserInRole(Principal user, String roleName) Check if a user is in a role. |
void | load(String config) Load realm users from properties file.
|
void | logout(Principal user) |
Principal | popRole(Principal user) |
Principal | pushRole(Principal user, String role) |
Object | put(Object name, Object credentials) Put user into realm. |
void | readExternal(ObjectInput in) |
boolean | reauthenticate(Principal user) |
void | setName(String name) |
void | setSingleSignOn(HttpRequest request, HttpResponse response, Principal principal, Credential credential) |
void | setSSORealm(SSORealm ssoRealm) Set the SSORealm.
|
String | toString() |
void | writeExternal(ObjectOutput out) |
Parameters: name Realm Name
Parameters: name Realm name config Filename or url of user properties file.
Parameters: userName roleName
Returns: The realm name.
Returns: The SSORealm to delegate single sign on requests to.
Parameters: user The user, which must be from this realm roleName
Returns: True if the user can act in the role.
Parameters: config Filename or url of user properties file.
Throws: IOException
Parameters: name User name credentials String password, Password or UserPrinciple instance.
Returns: Old UserPrinciple value or null
Parameters: name The realm name
Parameters: ssoRealm The SSORealm to delegate single sign on requests to.