Search in sources :

Example 6 with EncryptedElementType

use of org.keycloak.dom.saml.v2.assertion.EncryptedElementType in project keycloak by keycloak.

the class SAMLSubjectConfirmationParser method processSubElement.

@Override
protected void processSubElement(XMLEventReader xmlEventReader, SubjectConfirmationType target, SAMLAssertionQNames element, StartElement elementDetail) throws ParsingException {
    switch(element) {
        case NAMEID:
            NameIDType nameID = SAMLParserUtil.parseNameIDType(xmlEventReader);
            target.setNameID(nameID);
            break;
        case ENCRYPTED_ID:
            Element domElement = StaxParserUtil.getDOMElement(xmlEventReader);
            target.setEncryptedID(new EncryptedElementType(domElement));
            break;
        case SUBJECT_CONFIRMATION_DATA:
            SubjectConfirmationDataType subjectConfirmationData = SAMLSubjectConfirmationDataParser.INSTANCE.parse(xmlEventReader);
            target.setSubjectConfirmationData(subjectConfirmationData);
            break;
        default:
            throw LOGGER.parserUnknownTag(StaxParserUtil.getElementName(elementDetail), elementDetail.getLocation());
    }
}
Also used : SubjectConfirmationDataType(org.keycloak.dom.saml.v2.assertion.SubjectConfirmationDataType) Element(org.w3c.dom.Element) StartElement(javax.xml.stream.events.StartElement) NameIDType(org.keycloak.dom.saml.v2.assertion.NameIDType) EncryptedElementType(org.keycloak.dom.saml.v2.assertion.EncryptedElementType)

Aggregations

EncryptedElementType (org.keycloak.dom.saml.v2.assertion.EncryptedElementType)6 NameIDType (org.keycloak.dom.saml.v2.assertion.NameIDType)5 Element (org.w3c.dom.Element)4 StartElement (javax.xml.stream.events.StartElement)3 SubjectType (org.keycloak.dom.saml.v2.assertion.SubjectType)2 QName (javax.xml.namespace.QName)1 XMLEventReader (javax.xml.stream.XMLEventReader)1 ASTChoiceType (org.keycloak.dom.saml.v2.assertion.AttributeStatementType.ASTChoiceType)1 AttributeType (org.keycloak.dom.saml.v2.assertion.AttributeType)1 BaseIDAbstractType (org.keycloak.dom.saml.v2.assertion.BaseIDAbstractType)1 SubjectConfirmationDataType (org.keycloak.dom.saml.v2.assertion.SubjectConfirmationDataType)1 SubjectConfirmationType (org.keycloak.dom.saml.v2.assertion.SubjectConfirmationType)1 STSubType (org.keycloak.dom.saml.v2.assertion.SubjectType.STSubType)1 Document (org.w3c.dom.Document)1 Node (org.w3c.dom.Node)1