public class JAASUserRealm
extends java.lang.Object
implements org.mortbay.jetty.security.UserRealm
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
callbackHandlerClass |
static java.lang.String |
DEFAULT_ROLE_CLASS_NAME |
static java.lang.String[] |
DEFAULT_ROLE_CLASS_NAMES |
protected JAASUserPrincipal |
defaultUser |
protected java.lang.String |
loginModuleName |
protected java.lang.String |
realmName |
protected RoleCheckPolicy |
roleCheckPolicy |
protected java.lang.String[] |
roleClassNames |
Constructor and Description |
---|
JAASUserRealm()
Constructor.
|
JAASUserRealm(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.security.Principal |
authenticate(java.lang.String username,
java.lang.Object credentials,
org.mortbay.jetty.Request request)
Authenticate a user.
|
void |
disassociate(java.security.Principal user)
Removes any auth info associated with eg.
|
java.lang.String |
getName()
Get the name of the realm.
|
java.security.Principal |
getPrincipal(java.lang.String username) |
java.lang.String[] |
getRoleClassNames() |
java.security.acl.Group |
getRoles(JAASUserPrincipal principal) |
boolean |
isUserInRole(java.security.Principal user,
java.lang.String role) |
void |
logout(java.security.Principal user)
Logout a previously logged in user.
|
java.security.Principal |
popRole(java.security.Principal user) |
java.security.Principal |
pushRole(java.security.Principal user,
java.lang.String role)
Temporarily adds a role to a user.
|
boolean |
reauthenticate(java.security.Principal user) |
void |
setCallbackHandlerClass(java.lang.String classname) |
void |
setLoginModuleName(java.lang.String name)
Set the name to use to index into the config
file of LoginModules.
|
void |
setName(java.lang.String name)
Set the name of the realm
|
void |
setRoleCheckPolicy(RoleCheckPolicy policy) |
void |
setRoleClassNames(java.lang.String[] classnames) |
public static java.lang.String DEFAULT_ROLE_CLASS_NAME
public static java.lang.String[] DEFAULT_ROLE_CLASS_NAMES
protected java.lang.String[] roleClassNames
protected java.lang.String callbackHandlerClass
protected java.lang.String realmName
protected java.lang.String loginModuleName
protected RoleCheckPolicy roleCheckPolicy
protected JAASUserPrincipal defaultUser
public JAASUserRealm()
public JAASUserRealm(java.lang.String name)
name
- the name of the realmpublic java.lang.String getName()
getName
in interface org.mortbay.jetty.security.UserRealm
public void setName(java.lang.String name)
name
- a String
valuepublic void setLoginModuleName(java.lang.String name)
name
- a String
valuepublic void setCallbackHandlerClass(java.lang.String classname)
public void setRoleClassNames(java.lang.String[] classnames)
public java.lang.String[] getRoleClassNames()
public void setRoleCheckPolicy(RoleCheckPolicy policy)
public java.security.Principal getPrincipal(java.lang.String username)
getPrincipal
in interface org.mortbay.jetty.security.UserRealm
public boolean isUserInRole(java.security.Principal user, java.lang.String role)
isUserInRole
in interface org.mortbay.jetty.security.UserRealm
public boolean reauthenticate(java.security.Principal user)
reauthenticate
in interface org.mortbay.jetty.security.UserRealm
public java.security.Principal authenticate(java.lang.String username, java.lang.Object credentials, org.mortbay.jetty.Request request)
authenticate
in interface org.mortbay.jetty.security.UserRealm
username
- provided by the user at logincredentials
- provided by the user at loginrequest
- a Request
valuepublic void disassociate(java.security.Principal user)
disassociate
in interface org.mortbay.jetty.security.UserRealm
user
- a UserPrincipal to disassociatepublic java.security.Principal pushRole(java.security.Principal user, java.lang.String role)
pushRole
in interface org.mortbay.jetty.security.UserRealm
user
- the Principal to which to add the rolerole
- the role namepublic java.security.Principal popRole(java.security.Principal user)
popRole
in interface org.mortbay.jetty.security.UserRealm
public java.security.acl.Group getRoles(JAASUserPrincipal principal)
public void logout(java.security.Principal user)
logout
in interface org.mortbay.jetty.security.UserRealm
user
- an Principal
valueCopyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.