org.apache.cxf.interceptor.security
Class DefaultSecurityContext

java.lang.Object
  extended by org.apache.cxf.interceptor.security.DefaultSecurityContext
All Implemented Interfaces:
org.apache.cxf.security.LoginSecurityContext, org.apache.cxf.security.SecurityContext

public class DefaultSecurityContext
extends Object
implements org.apache.cxf.security.LoginSecurityContext

SecurityContext which implements isUserInRole using the following approach : skip the first Subject principal, and then checks Groups the principal is a member of TODO : consider moving this class into a rt-core-security module


Constructor Summary
DefaultSecurityContext(Principal p, Subject subject)
           
DefaultSecurityContext(Subject subject)
           
 
Method Summary
protected  boolean checkGroup(Group group, String role)
           
 Subject getSubject()
           
 Principal getUserPrincipal()
           
 Set<Principal> getUserRoles()
           
 boolean isUserInRole(String role)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSecurityContext

public DefaultSecurityContext(Subject subject)

DefaultSecurityContext

public DefaultSecurityContext(Principal p,
                              Subject subject)
Method Detail

getUserPrincipal

public Principal getUserPrincipal()
Specified by:
getUserPrincipal in interface org.apache.cxf.security.SecurityContext

isUserInRole

public boolean isUserInRole(String role)
Specified by:
isUserInRole in interface org.apache.cxf.security.SecurityContext

checkGroup

protected boolean checkGroup(Group group,
                             String role)

getSubject

public Subject getSubject()
Specified by:
getSubject in interface org.apache.cxf.security.LoginSecurityContext

getUserRoles

public Set<Principal> getUserRoles()
Specified by:
getUserRoles in interface org.apache.cxf.security.LoginSecurityContext


Apache CXF