| org.mortbay.jetty.security.UserRealm
All known Subclasses: org.mortbay.jetty.security.HashUserRealm, org.mortbay.jetty.security.JDBCUserRealm, org.mortbay.jetty.plus.jaas.JAASUserRealm,
UserRealm | public interface UserRealm (Code) | | User Realm.
This interface should be specialized to provide specific user
lookup and authentication using arbitrary methods.
For SSO implementation sof UserRealm should also implement SSORealm.
See Also: SSORealm author: Greg Wilkins (gregw) |
Method Summary | |
public Principal | authenticate(String username, Object credentials, Request request) Authenticate a users credentials.
Implementations of this method may adorn the calling context to
assoicate it with the authenticated principal (eg ThreadLocals). | public void | disassociate(Principal user) Dissassociate the calling context with a Principal.
This method is called when the calling context is not longer
associated with the Principal. | public String | getName() | public Principal | getPrincipal(String username) Get the principal for a username. | public boolean | isUserInRole(Principal user, String role) Check if the user is in a role. | public void | logout(Principal user) logout a user Principal. | public Principal | popRole(Principal user) Pop role from a Principal.
Parameters: user - A UserPrincipal previously returned from pushRole The principal without the role. | public Principal | pushRole(Principal user, String role) Push role onto a Principal.
This method is used to add a role to an existing principal.
Parameters: user - An existing UserPrincipal or null for an anonymous user. Parameters: role - The role to add. | public boolean | reauthenticate(Principal user) Re Authenticate a Principal.
Authenicate a principal that has previously been return from the authenticate method.
Implementations of this method may adorn the calling context to
assoicate it with the authenticated principal (eg ThreadLocals). |
authenticate | public Principal authenticate(String username, Object credentials, Request request)(Code) | | Authenticate a users credentials.
Implementations of this method may adorn the calling context to
assoicate it with the authenticated principal (eg ThreadLocals). If
such context associations are made, they should be considered valid
until a UserRealm.deAuthenticate(UserPrincipal) call is made for this
UserPrincipal.
Parameters: username - The username. Parameters: credentials - The user credentials, normally a String password. Parameters: request - The request to be authenticated. Additionalparameters may be extracted or set on this request as neededfor the authentication mechanism (none required for BASIC andFORM authentication). The authenticated UserPrincipal. |
disassociate | public void disassociate(Principal user)(Code) | | Dissassociate the calling context with a Principal.
This method is called when the calling context is not longer
associated with the Principal. It should be used by an implementation
to remove context associations such as ThreadLocals.
The UserPrincipal object remains authenticated, as it may be
associated with other contexts.
Parameters: user - A UserPrincipal allocated from this realm. |
getPrincipal | public Principal getPrincipal(String username)(Code) | | Get the principal for a username.
This method is not guaranteed to return a Principal for non-authenticated users.
|
isUserInRole | public boolean isUserInRole(Principal user, String role)(Code) | | Check if the user is in a role.
Parameters: role - A role name. True if the user can act in that role. |
logout | public void logout(Principal user)(Code) | | logout a user Principal.
Called by authentication mechanisms (eg FORM) that can detect logout.
Parameters: user - A Principal previously returned from this realm |
popRole | public Principal popRole(Principal user)(Code) | | Pop role from a Principal.
Parameters: user - A UserPrincipal previously returned from pushRole The principal without the role. Most often this will be theoriginal UserPrincipal passed. |
pushRole | public Principal pushRole(Principal user, String role)(Code) | | Push role onto a Principal.
This method is used to add a role to an existing principal.
Parameters: user - An existing UserPrincipal or null for an anonymous user. Parameters: role - The role to add. A new UserPrincipal object that wraps the passed user, butwith the added role. |
reauthenticate | public boolean reauthenticate(Principal user)(Code) | | Re Authenticate a Principal.
Authenicate a principal that has previously been return from the authenticate method.
Implementations of this method may adorn the calling context to
assoicate it with the authenticated principal (eg ThreadLocals). If
such context associations are made, they should be considered valid
until a UserRealm.deAuthenticate(UserPrincipal) call is made for this
UserPrincipal.
True if this user is still authenticated. |
|
|