Class DefaultSubjectRoleParser
java.lang.Object
org.apache.cxf.sts.token.validator.DefaultSubjectRoleParser
- All Implemented Interfaces:
SubjectRoleParser
- Direct Known Subclasses:
DefaultJWTRoleParser,DefaultSAMLRoleParser
A default implementation to extract roles from a Subject
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionparseRolesFromSubject(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.
-
Constructor Details
-
DefaultSubjectRoleParser
public DefaultSubjectRoleParser()
-
-
Method Details
-
parseRolesFromSubject
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
-
setRoleClassifier
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
-
setRoleClassifierType
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
-