Search in sources :

Example 1 with CommonStatusDetailType

use of org.keycloak.dom.saml.common.CommonStatusDetailType in project keycloak by keycloak.

the class SAML11ResponseWriter method write.

public void write(SAML11StatusType status) throws ProcessingException {
    StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, SAML11Constants.STATUS, namespace);
    SAML11StatusCodeType statusCode = status.getStatusCode();
    if (statusCode != null) {
        write(statusCode);
    }
    String statusMsg = status.getStatusMessage();
    if (StringUtil.isNotNull(statusMsg)) {
        StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, SAML11Constants.STATUS_MSG, namespace);
        StaxUtil.writeCharacters(writer, statusMsg);
        StaxUtil.writeEndElement(writer);
    }
    CommonStatusDetailType details = status.getStatusDetail();
    if (details != null) {
        StaxUtil.writeStartElement(writer, PROTOCOL_PREFIX, SAML11Constants.STATUS_DETAIL, namespace);
        List<Object> objs = details.getAny();
        for (Object theObj : objs) {
            StaxUtil.writeCharacters(writer, theObj.toString());
        }
        StaxUtil.writeEndElement(writer);
    }
    StaxUtil.writeEndElement(writer);
    StaxUtil.flush(writer);
}
Also used : CommonStatusDetailType(org.keycloak.dom.saml.common.CommonStatusDetailType) SAML11StatusCodeType(org.keycloak.dom.saml.v1.protocol.SAML11StatusCodeType)

Aggregations

CommonStatusDetailType (org.keycloak.dom.saml.common.CommonStatusDetailType)1 SAML11StatusCodeType (org.keycloak.dom.saml.v1.protocol.SAML11StatusCodeType)1