Search in sources :

Example 1 with StatusCodeBuilder

use of org.opensaml.saml.saml2.core.impl.StatusCodeBuilder in project ddf by codice.

the class LoginFilter method createStatus.

/**
     * Creates the status object for the response.
     *
     * @param statusCodeValue
     * @param statusMessage
     * @return Status
     */
private static Status createStatus(String statusCodeValue, String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = (SAMLObjectBuilder<Status>) builderFactory.getBuilder(Status.DEFAULT_ELEMENT_NAME);
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = (SAMLObjectBuilder<StatusCode>) builderFactory.getBuilder(StatusCode.DEFAULT_ELEMENT_NAME);
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>) builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Example 2 with StatusCodeBuilder

use of org.opensaml.saml.saml2.core.impl.StatusCodeBuilder in project syncope by apache.

the class SAML2PResponseComponentBuilder method createStatus.

public static Status createStatus(final String statusCodeValue, final String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = new StatusBuilder();
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = new StatusCodeBuilder();
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = new StatusMessageBuilder();
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusMessageBuilder(org.opensaml.saml.saml2.core.impl.StatusMessageBuilder) StatusCodeBuilder(org.opensaml.saml.saml2.core.impl.StatusCodeBuilder) StatusBuilder(org.opensaml.saml.saml2.core.impl.StatusBuilder) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Example 3 with StatusCodeBuilder

use of org.opensaml.saml.saml2.core.impl.StatusCodeBuilder in project spring-security by spring-projects.

the class TestOpenSamlObjects method status.

static Status status(String code) {
    Status status = new StatusBuilder().buildObject();
    StatusCode statusCode = new StatusCodeBuilder().buildObject();
    statusCode.setValue(code);
    status.setStatusCode(statusCode);
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCodeBuilder(org.opensaml.saml.saml2.core.impl.StatusCodeBuilder) StatusBuilder(org.opensaml.saml.saml2.core.impl.StatusBuilder) StatusCode(org.opensaml.saml.saml2.core.StatusCode)

Example 4 with StatusCodeBuilder

use of org.opensaml.saml.saml2.core.impl.StatusCodeBuilder in project verify-hub by alphagov.

the class ResponseValidatorTestHelper method createStatus.

public static Status createStatus(String statusCodeValue, StatusCode subStatusCode) {
    StatusCodeBuilder statusCodeBuilder = aStatusCode().withValue(statusCodeValue);
    StatusCode statusCode = subStatusCode == null ? statusCodeBuilder.build() : statusCodeBuilder.withSubStatusCode(subStatusCode).build();
    return aStatus().withStatusCode(statusCode).build();
}
Also used : StatusCodeBuilder(uk.gov.ida.saml.core.test.builders.StatusCodeBuilder) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusCodeBuilder.aStatusCode(uk.gov.ida.saml.core.test.builders.StatusCodeBuilder.aStatusCode)

Example 5 with StatusCodeBuilder

use of org.opensaml.saml.saml2.core.impl.StatusCodeBuilder in project testcases by coheigea.

the class SAML2PResponseComponentBuilder method createStatus.

@SuppressWarnings("unchecked")
public static Status createStatus(String statusCodeValue, String statusMessage) {
    if (statusBuilder == null) {
        statusBuilder = (SAMLObjectBuilder<Status>) builderFactory.getBuilder(Status.DEFAULT_ELEMENT_NAME);
    }
    if (statusCodeBuilder == null) {
        statusCodeBuilder = (SAMLObjectBuilder<StatusCode>) builderFactory.getBuilder(StatusCode.DEFAULT_ELEMENT_NAME);
    }
    if (statusMessageBuilder == null) {
        statusMessageBuilder = (SAMLObjectBuilder<StatusMessage>) builderFactory.getBuilder(StatusMessage.DEFAULT_ELEMENT_NAME);
    }
    Status status = statusBuilder.buildObject();
    StatusCode statusCode = statusCodeBuilder.buildObject();
    statusCode.setValue(statusCodeValue);
    status.setStatusCode(statusCode);
    if (statusMessage != null) {
        StatusMessage statusMessageObject = statusMessageBuilder.buildObject();
        statusMessageObject.setMessage(statusMessage);
        status.setStatusMessage(statusMessageObject);
    }
    return status;
}
Also used : Status(org.opensaml.saml.saml2.core.Status) StatusCode(org.opensaml.saml.saml2.core.StatusCode) StatusMessage(org.opensaml.saml.saml2.core.StatusMessage)

Aggregations

StatusCode (org.opensaml.saml.saml2.core.StatusCode)8 Status (org.opensaml.saml.saml2.core.Status)7 StatusMessage (org.opensaml.saml.saml2.core.StatusMessage)5 StatusBuilder (org.opensaml.saml.saml2.core.impl.StatusBuilder)3 StatusCodeBuilder (org.opensaml.saml.saml2.core.impl.StatusCodeBuilder)3 HttpServletResponse (javax.servlet.http.HttpServletResponse)1 DateTime (org.joda.time.DateTime)1 Issuer (org.opensaml.saml.saml2.core.Issuer)1 LogoutResponse (org.opensaml.saml.saml2.core.LogoutResponse)1 IssuerBuilder (org.opensaml.saml.saml2.core.impl.IssuerBuilder)1 LogoutResponseBuilder (org.opensaml.saml.saml2.core.impl.LogoutResponseBuilder)1 StatusMessageBuilder (org.opensaml.saml.saml2.core.impl.StatusMessageBuilder)1 Assertion (org.opensaml.saml2.core.Assertion)1 AttributeStatement (org.opensaml.saml2.core.AttributeStatement)1 AuthnStatement (org.opensaml.saml2.core.AuthnStatement)1 Issuer (org.opensaml.saml2.core.Issuer)1 NameID (org.opensaml.saml2.core.NameID)1 Response (org.opensaml.saml2.core.Response)1 Status (org.opensaml.saml2.core.Status)1 StatusCode (org.opensaml.saml2.core.StatusCode)1