Search in sources :

Example 1 with BaseSAML2MessageEncoder

use of org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder in project cas by apereo.

the class BaseSamlResponseEncoder method encode.

/**
 * Encode.
 *
 * @param samlResponse the saml response
 * @param relayState   the relay state
 * @return the response
 * @throws SamlException the saml exception
 */
@SneakyThrows
public final Response encode(final Response samlResponse, final String relayState) throws SamlException {
    if (httpResponse != null) {
        final BaseSAML2MessageEncoder encoder = getMessageEncoderInstance();
        encoder.setHttpServletResponse(httpResponse);
        final MessageContext ctx = getEncoderMessageContext(samlResponse, relayState);
        encoder.setMessageContext(ctx);
        finalizeEncode(encoder, samlResponse, relayState);
    }
    return samlResponse;
}
Also used : BaseSAML2MessageEncoder(org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder) MessageContext(org.opensaml.messaging.context.MessageContext) SneakyThrows(lombok.SneakyThrows)

Example 2 with BaseSAML2MessageEncoder

use of org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder in project cas by apereo.

the class SamlResponseArtifactEncoder method finalizeEncode.

@Override
protected void finalizeEncode(final BaseSAML2MessageEncoder e, final Response samlResponse, final String relayState) throws Exception {
    final HTTPArtifactEncoder encoder = (HTTPArtifactEncoder) e;
    encoder.setArtifactMap(this.samlArtifactMap);
    final MessageContext ctx = getEncoderMessageContext(samlResponse, relayState);
    prepareArtifactContext(samlResponse, ctx);
    encoder.setMessageContext(ctx);
    super.finalizeEncode(encoder, samlResponse, relayState);
}
Also used : MessageContext(org.opensaml.messaging.context.MessageContext) HTTPArtifactEncoder(org.opensaml.saml.saml2.binding.encoding.impl.HTTPArtifactEncoder)

Example 3 with BaseSAML2MessageEncoder

use of org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder in project cas by apereo.

the class SamlResponsePostSimpleSignEncoder method getMessageEncoderInstance.

@Override
protected BaseSAML2MessageEncoder getMessageEncoderInstance() throws Exception {
    final HTTPPostSimpleSignEncoder encoder = new HTTPPostSimpleSignEncoder();
    encoder.setVelocityEngine(this.velocityEngineFactory);
    return encoder;
}
Also used : HTTPPostSimpleSignEncoder(org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostSimpleSignEncoder)

Example 4 with BaseSAML2MessageEncoder

use of org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder in project cas by apereo.

the class SamlResponsePostEncoder method getMessageEncoderInstance.

@Override
protected BaseSAML2MessageEncoder getMessageEncoderInstance() {
    val encoder = new HTTPPostEncoder();
    encoder.setVelocityEngine(this.velocityEngineFactory);
    return encoder;
}
Also used : lombok.val(lombok.val) HTTPPostEncoder(org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostEncoder)

Example 5 with BaseSAML2MessageEncoder

use of org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder in project cas by apereo.

the class SamlResponsePostSimpleSignEncoder method getMessageEncoderInstance.

@Override
protected BaseSAML2MessageEncoder getMessageEncoderInstance() {
    val encoder = new HTTPPostSimpleSignEncoder();
    encoder.setVelocityEngine(this.velocityEngineFactory);
    return encoder;
}
Also used : lombok.val(lombok.val) HTTPPostSimpleSignEncoder(org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostSimpleSignEncoder)

Aggregations

lombok.val (lombok.val)4 HTTPArtifactEncoder (org.opensaml.saml.saml2.binding.encoding.impl.HTTPArtifactEncoder)4 MessageContext (org.opensaml.messaging.context.MessageContext)2 HTTPPostEncoder (org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostEncoder)2 HTTPPostSimpleSignEncoder (org.opensaml.saml.saml2.binding.encoding.impl.HTTPPostSimpleSignEncoder)2 SneakyThrows (lombok.SneakyThrows)1 BaseSAML2MessageEncoder (org.opensaml.saml.saml2.binding.encoding.impl.BaseSAML2MessageEncoder)1