Class DefaultSubjectRoleParser
- java.lang.Object
-
- org.apache.cxf.sts.token.validator.DefaultSubjectRoleParser
-
- All Implemented Interfaces:
SubjectRoleParser
- Direct Known Subclasses:
DefaultJWTRoleParser,DefaultSAMLRoleParser
public class DefaultSubjectRoleParser extends Object implements SubjectRoleParser
A default implementation to extract roles from a Subject
-
-
Constructor Summary
Constructors Constructor Description DefaultSubjectRoleParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRoleClassifier()StringgetRoleClassifierType()Set<Principal>parseRolesFromSubject(Principal principal, Subject subject)Return the set of User/Principal roles from the Subject.voidsetRoleClassifier(String roleClassifier)Set the Subject Role Classifier to use.voidsetRoleClassifierType(String roleClassifierType)Set the Subject Role Classifier Type to use.
-
-
-
Method Detail
-
parseRolesFromSubject
public Set<Principal> parseRolesFromSubject(Principal principal, Subject subject)
Return the set of User/Principal roles from the Subject.- Specified by:
parseRolesFromSubjectin interfaceSubjectRoleParser- Parameters:
principal- the optional Principalsubject- the JAAS Subject- Returns:
- the set of User/Principal roles from the Subject.
-
getRoleClassifier
public String getRoleClassifier()
-
setRoleClassifier
public void setRoleClassifier(String roleClassifier)
Set the Subject Role Classifier to use. If this value is not specified, then it tries to get roles from the supplied JAAS Subject (if not null) using the DefaultSecurityContext in cxf-rt-core. Otherwise it uses this value in combination with the SUBJECT_ROLE_CLASSIFIER_TYPE to get the roles from the Subject.- Parameters:
roleClassifier- the Subject Role Classifier to use
-
getRoleClassifierType
public String getRoleClassifierType()
-
setRoleClassifierType
public void setRoleClassifierType(String roleClassifierType)
Set the Subject Role Classifier Type to use. Currently accepted values are "prefix" or "classname". Must be used in conjunction with the SUBJECT_ROLE_CLASSIFIER. The default value is "prefix".- Parameters:
roleClassifierType- the Subject Role Classifier Type to use
-
-