use of org.apache.wss4j.policy.model.SupportingTokens in project cxf by apache.
the class UsernameTokenPolicyValidator method isNonEndorsingSupportingToken.
/**
* Return true if this UsernameToken policy is a (non-endorsing)SupportingToken. If this is
* true then the corresponding UsernameToken must have a password element.
*/
private boolean isNonEndorsingSupportingToken(org.apache.wss4j.policy.model.UsernameToken usernameTokenPolicy) {
AbstractSecurityAssertion parentAssertion = usernameTokenPolicy.getParentAssertion();
if (parentAssertion instanceof SupportingTokens) {
SupportingTokens supportingToken = (SupportingTokens) parentAssertion;
String localname = supportingToken.getName().getLocalPart();
if (localname.equals(SPConstants.SUPPORTING_TOKENS) || localname.equals(SPConstants.SIGNED_SUPPORTING_TOKENS) || localname.equals(SPConstants.ENCRYPTED_SUPPORTING_TOKENS) || localname.equals(SPConstants.SIGNED_ENCRYPTED_SUPPORTING_TOKENS)) {
return true;
}
}
return false;
}
Aggregations