public class JAASUserPrincipal
extends java.lang.Object
implements java.security.Principal
Implements the JAAS version of the org.mortbay.http.UserPrincipal interface.
Modifier and Type | Class and Description |
---|---|
static class |
JAASUserPrincipal.RoleStack
RoleStack
|
Constructor and Description |
---|
JAASUserPrincipal(JAASUserRealm realm,
java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
disassociate()
Clean out any pushed roles that haven't been popped
|
protected javax.security.auth.login.LoginContext |
getLoginContext() |
java.lang.String |
getName()
Get the name identifying the user
|
JAASUserRealm |
getRealm() |
java.security.acl.Group |
getRoles()
Determine the roles that the LoginModule has set
|
javax.security.auth.Subject |
getSubject()
Provide access to the current Subject
|
boolean |
isUserInRole(java.lang.String roleName)
Check if user is in role
|
void |
popRole()
Remove temporary association between user and role.
|
void |
pushRole(java.lang.String roleName)
Temporarily associate a user with a role.
|
protected void |
setLoginContext(javax.security.auth.login.LoginContext loginContext) |
void |
setRoleCheckPolicy(RoleCheckPolicy policy)
Set the type of checking for isUserInRole
|
protected void |
setSubject(javax.security.auth.Subject subject)
Sets the JAAS subject for this user.
|
java.lang.String |
toString() |
public JAASUserPrincipal(JAASUserRealm realm, java.lang.String name)
name
- the name identifying the userpublic JAASUserRealm getRealm()
public boolean isUserInRole(java.lang.String roleName)
roleName
- role to checkpublic java.security.acl.Group getRoles()
Group
of Principals
representing the roles this user holdspublic void setRoleCheckPolicy(RoleCheckPolicy policy)
policy
- public void pushRole(java.lang.String roleName)
roleName
- public void popRole()
public void disassociate()
public java.lang.String getName()
getName
in interface java.security.Principal
protected void setSubject(javax.security.auth.Subject subject)
subject
- public javax.security.auth.Subject getSubject()
protected void setLoginContext(javax.security.auth.login.LoginContext loginContext)
protected javax.security.auth.login.LoginContext getLoginContext()
public java.lang.String toString()
toString
in interface java.security.Principal
toString
in class java.lang.Object
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.