Search in sources :

Example 16 with SupportingTokens

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;
}
Also used : SupportingTokens(org.apache.wss4j.policy.model.SupportingTokens) AbstractSecurityAssertion(org.apache.wss4j.policy.model.AbstractSecurityAssertion)

Aggregations

SupportingTokens (org.apache.wss4j.policy.model.SupportingTokens)16 AssertionInfo (org.apache.cxf.ws.policy.AssertionInfo)14 AbstractToken (org.apache.wss4j.policy.model.AbstractToken)11 SamlToken (org.apache.wss4j.policy.model.SamlToken)9 IssuedToken (org.apache.wss4j.policy.model.IssuedToken)8 KerberosToken (org.apache.wss4j.policy.model.KerberosToken)8 KeyValueToken (org.apache.wss4j.policy.model.KeyValueToken)8 SecurityContextToken (org.apache.wss4j.policy.model.SecurityContextToken)8 UsernameToken (org.apache.wss4j.policy.model.UsernameToken)8 X509Token (org.apache.wss4j.policy.model.X509Token)8 SpnegoContextToken (org.apache.wss4j.policy.model.SpnegoContextToken)7 DerivedKeys (org.apache.wss4j.policy.model.AbstractToken.DerivedKeys)4 AbstractSecurityAssertion (org.apache.wss4j.policy.model.AbstractSecurityAssertion)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Fault (org.apache.cxf.interceptor.Fault)1 All (org.apache.neethi.All)1 ExactlyOne (org.apache.neethi.ExactlyOne)1 Policy (org.apache.neethi.Policy)1 AlgorithmSuite (org.apache.wss4j.common.crypto.AlgorithmSuite)1