Search in sources :

Example 1 with SAML11EvidenceType

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

the class SAML11RequestWriter method write.

public void write(SAML11AuthorizationDecisionQueryType attr) throws ProcessingException {
    StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, SAML11Constants.AUTHORIZATION_DECISION_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<SAML11ActionType> actions = attr.get();
    for (SAML11ActionType action : actions) {
        assertionWriter.write(action);
    }
    SAML11EvidenceType evidence = attr.getEvidence();
    if (evidence != null) {
        assertionWriter.write(evidence);
    }
    StaxUtil.writeEndElement(writer);
    StaxUtil.flush(writer);
}
Also used : SAML11SubjectType(org.keycloak.dom.saml.v1.assertion.SAML11SubjectType) SAML11EvidenceType(org.keycloak.dom.saml.v1.assertion.SAML11EvidenceType) SAML11ActionType(org.keycloak.dom.saml.v1.assertion.SAML11ActionType) URI(java.net.URI)

Example 2 with SAML11EvidenceType

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

the class SAML11AssertionWriter method write.

public void write(SAML11EvidenceType evidence) throws ProcessingException {
    StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, SAML11Constants.EVIDENCE, ns);
    List<String> assertionIDRefs = evidence.getAssertionIDReference();
    for (String assertionIDRef : assertionIDRefs) {
        StaxUtil.writeStartElement(writer, ASSERTION_PREFIX, SAML11Constants.ASSERTION_ID_REF, ns);
        StaxUtil.writeCharacters(writer, assertionIDRef);
        StaxUtil.writeEndElement(writer);
    }
    List<SAML11AssertionType> assertions = evidence.getAssertions();
    for (SAML11AssertionType assertion : assertions) {
        write(assertion);
    }
    StaxUtil.writeEndElement(writer);
}
Also used : SAML11AssertionType(org.keycloak.dom.saml.v1.assertion.SAML11AssertionType)

Aggregations

URI (java.net.URI)1 SAML11ActionType (org.keycloak.dom.saml.v1.assertion.SAML11ActionType)1 SAML11AssertionType (org.keycloak.dom.saml.v1.assertion.SAML11AssertionType)1 SAML11EvidenceType (org.keycloak.dom.saml.v1.assertion.SAML11EvidenceType)1 SAML11SubjectType (org.keycloak.dom.saml.v1.assertion.SAML11SubjectType)1