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