Search in sources :

Example 1 with AuthorizationDecisionStatement

use of org.opensaml.saml.saml1.core.AuthorizationDecisionStatement in project cxf by apache.

the class SAMLUtils method getSaml1Subject.

private static org.opensaml.saml.saml1.core.Subject getSaml1Subject(SamlAssertionWrapper assertionW) {
    for (Statement stmt : assertionW.getSaml1().getStatements()) {
        org.opensaml.saml.saml1.core.Subject samlSubject = null;
        if (stmt instanceof AttributeStatement) {
            AttributeStatement attrStmt = (AttributeStatement) stmt;
            samlSubject = attrStmt.getSubject();
        } else if (stmt instanceof AuthenticationStatement) {
            AuthenticationStatement authStmt = (AuthenticationStatement) stmt;
            samlSubject = authStmt.getSubject();
        } else {
            AuthorizationDecisionStatement authzStmt = (AuthorizationDecisionStatement) stmt;
            samlSubject = authzStmt.getSubject();
        }
        if (samlSubject != null) {
            return samlSubject;
        }
    }
    return null;
}
Also used : Statement(org.opensaml.saml.saml1.core.Statement) AuthorizationDecisionStatement(org.opensaml.saml.saml1.core.AuthorizationDecisionStatement) AuthenticationStatement(org.opensaml.saml.saml1.core.AuthenticationStatement) AttributeStatement(org.opensaml.saml.saml1.core.AttributeStatement) AttributeStatement(org.opensaml.saml.saml1.core.AttributeStatement) AuthorizationDecisionStatement(org.opensaml.saml.saml1.core.AuthorizationDecisionStatement) AuthenticationStatement(org.opensaml.saml.saml1.core.AuthenticationStatement)

Aggregations

AttributeStatement (org.opensaml.saml.saml1.core.AttributeStatement)1 AuthenticationStatement (org.opensaml.saml.saml1.core.AuthenticationStatement)1 AuthorizationDecisionStatement (org.opensaml.saml.saml1.core.AuthorizationDecisionStatement)1 Statement (org.opensaml.saml.saml1.core.Statement)1