Search in sources :

Example 1 with SAML11AttributeDesignatorType

use of org.keycloak.dom.saml.v1.assertion.SAML11AttributeDesignatorType in project keycloak by keycloak.

the class SAML11RequestWriter method write.

public void write(SAML11AttributeQueryType attr) throws ProcessingException {
    StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, SAML11Constants.ATTRIBUTE_QUERY, namespace);
    URI resource = attr.getResource();
    if (resource != null) {
        StaxUtil.writeAttribute(writer, SAML11Constants.RESOURCE, resource.toString());
    }
    SAML11SubjectType subject = attr.getSubject();
    if (subject != null) {
        assertionWriter.write(subject);
    }
    List<SAML11AttributeDesignatorType> attributes = attr.get();
    for (SAML11AttributeDesignatorType attribute : attributes) {
        if (attribute instanceof SAML11AttributeType) {
            SAML11AttributeType sat = (SAML11AttributeType) attribute;
            assertionWriter.write(sat);
        } else
            throw logger.writerUnknownTypeError(attribute.getClass().getName());
    }
    StaxUtil.writeEndElement(writer);
    StaxUtil.flush(writer);
}
Also used : SAML11SubjectType(org.keycloak.dom.saml.v1.assertion.SAML11SubjectType) SAML11AttributeDesignatorType(org.keycloak.dom.saml.v1.assertion.SAML11AttributeDesignatorType) SAML11AttributeType(org.keycloak.dom.saml.v1.assertion.SAML11AttributeType) URI(java.net.URI)

Aggregations

URI (java.net.URI)1 SAML11AttributeDesignatorType (org.keycloak.dom.saml.v1.assertion.SAML11AttributeDesignatorType)1 SAML11AttributeType (org.keycloak.dom.saml.v1.assertion.SAML11AttributeType)1 SAML11SubjectType (org.keycloak.dom.saml.v1.assertion.SAML11SubjectType)1