Search in sources :

Example 16 with SubjectConfirmation

use of com.sun.identity.saml.assertion.SubjectConfirmation in project OpenAM by OpenRock.

the class DefaultAttributeMapper method getSSOTokenID.

/**
     * This method exams the SubjectConfirmation of the Subject in the
     * AttributeQuery. If it has only one ConfirmationMethod, and this
     * ConfirmationMethod equals to "urn:com:sun:identity"; and its
     * SubjectConfirmationData contains TEXT node only, then the method
     * returns the concatenated string of all the TEXT nodes. Otherwise,
     * it returns null.
     * <p>
     * @param query the <code>AttributeQuery</code> object.
     * @see com.sun.identity.saml.plugins.AttributeMapper#getSSOTokenID
     */
public String getSSOTokenID(AttributeQuery query) {
    if (query == null) {
        return null;
    }
    SubjectConfirmation sc = query.getSubject().getSubjectConfirmation();
    if (sc == null) {
        return null;
    }
    if (!SAMLUtils.isCorrectConfirmationMethod(sc)) {
        return null;
    }
    Element scData = sc.getSubjectConfirmationData();
    return XMLUtils.getElementString(scData);
}
Also used : SubjectConfirmation(com.sun.identity.saml.assertion.SubjectConfirmation) Element(org.w3c.dom.Element)

Aggregations

SubjectConfirmation (com.sun.identity.saml.assertion.SubjectConfirmation)16 Subject (com.sun.identity.saml.assertion.Subject)9 Set (java.util.Set)9 HashSet (java.util.HashSet)8 Iterator (java.util.Iterator)8 SessionException (com.sun.identity.plugin.session.SessionException)5 AttributeStatement (com.sun.identity.saml.assertion.AttributeStatement)5 Statement (com.sun.identity.saml.assertion.Statement)5 SubjectStatement (com.sun.identity.saml.assertion.SubjectStatement)5 SAMLException (com.sun.identity.saml.common.SAMLException)5 Date (java.util.Date)5 Assertion (com.sun.identity.saml.assertion.Assertion)4 AuthenticationStatement (com.sun.identity.saml.assertion.AuthenticationStatement)4 Conditions (com.sun.identity.saml.assertion.Conditions)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 Element (org.w3c.dom.Element)4 FSException (com.sun.identity.federation.common.FSException)3 FSAssertion (com.sun.identity.federation.message.FSAssertion)3 FSAuthenticationStatement (com.sun.identity.federation.message.FSAuthenticationStatement)3