org.mortbay.jaas
Class JAASUserPrincipal

java.lang.Object
  |
  +--org.mortbay.jaas.JAASUserPrincipal
All Implemented Interfaces:
java.security.Principal, UserPrincipal

public class JAASUserPrincipal
extends java.lang.Object
implements UserPrincipal

JAASUserPrincipal

Implements the JAAS version of the org.mortbay.http.UserPrincipal interface.

Notes

Usage


Nested Class Summary
static class JAASUserPrincipal.RoleStack
          RoleStack
 
Constructor Summary
JAASUserPrincipal(java.lang.String name)
          Constructor.
 
Method Summary
 void disassociate()
          Clean out any pushed roles that haven't been popped
 java.lang.String getName()
          Get the name identifying the user
 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 isAuthenticated()
          Is this user authenticated
 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.
 void setRoleCheckPolicy(RoleCheckPolicy policy)
          Set the type of checking for isUserInRole
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Constructor Detail

JAASUserPrincipal

public JAASUserPrincipal(java.lang.String name)
Constructor.

Parameters:
name - the name identifying the user
Method Detail

isAuthenticated

public boolean isAuthenticated()
Is this user authenticated

Specified by:
isAuthenticated in interface UserPrincipal
Returns:
true if authenticated false otherwise

isUserInRole

public boolean isUserInRole(java.lang.String roleName)
Check if user is in role

Specified by:
isUserInRole in interface UserPrincipal
Parameters:
roleName - role to check
Returns:
true or false accordint to the RoleCheckPolicy.

getRoles

public java.security.acl.Group getRoles()
Determine the roles that the LoginModule has set

Returns:

setRoleCheckPolicy

public void setRoleCheckPolicy(RoleCheckPolicy policy)
Set the type of checking for isUserInRole

Parameters:
policy -

pushRole

public void pushRole(java.lang.String roleName)
Temporarily associate a user with a role.

Parameters:
roleName -

popRole

public void popRole()
Remove temporary association between user and role.


disassociate

public void disassociate()
Clean out any pushed roles that haven't been popped


getName

public java.lang.String getName()
Get the name identifying the user

Specified by:
getName in interface java.security.Principal
Returns:

getSubject

public javax.security.auth.Subject getSubject()
Provide access to the current Subject

Returns:


Copyright ? 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.