Class HTTPPostEncoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
org.opensaml.saml.common.binding.impl.BaseSAMLHttpServletResponseEncoder
org.opensaml.saml.saml1.binding.encoding.impl.BaseSAML1MessageEncoder
org.opensaml.saml.saml1.binding.encoding.impl.HTTPPostEncoder
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,HTMLMessageEncoder,MessageEncoder,HttpServletResponseMessageEncoder,SAMLMessageEncoder
SAML 1.X HTTP POST message encoder.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringDigesterDigester for CSP hashes.private IdentifierGenerationStrategyGenerator for CSP nonces.static final StringDefault template ID.private final org.slf4j.LoggerClass logger.private org.apache.velocity.app.VelocityEngineVelocity engine used to evaluate the template when performing POST encoding.private StringID of the velocity template used when performing POST encoding.Fields inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoEncode()Performs the encoding logic.protected voidGets the SAML binding URI supported by this encoder.org.apache.velocity.app.VelocityEngineGet the VelocityEngine instance.Get the Velocity template id.protected voidpostEncode(MessageContext messageContext, String endpointURL) Base64 and POST encodes the outbound message and writes it to the outbound transport.voidsetCSPDigester(StringDigester digester) Set aStringDigesterto use to generate CSP hashes.voidSet aIdentifierGenerationStrategyto use to generate CSP nonces.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.voidsetVelocityTemplateId(String newVelocityTemplateId) Set the Velocity template id.Methods inherited from class org.opensaml.saml.saml1.binding.encoding.impl.BaseSAML1MessageEncoder
getEndpointURLMethods inherited from class org.opensaml.messaging.encoder.servlet.BaseHttpServletResponseXMLMessageEncoder
encode, marshallMessage, serializeMessageForLoggingMethods inherited from class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
getHttpServletResponse, getHttpServletResponseSupplier, setHttpServletResponseSupplierMethods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
getMessageContext, getMessageToLog, getProtocolMessageLogger, getProtocolMessageLoggerSubCategory, logEncodedMessage, prepareContext, setMessageContext, setProtocolMessageLoggerSubCategoryMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitializedMethods inherited from interface org.opensaml.messaging.encoder.MessageEncoder
encode, prepareContext, setMessageContext
-
Field Details
-
DEFAULT_TEMPLATE_ID
Default template ID.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
velocityEngine
Velocity engine used to evaluate the template when performing POST encoding. -
velocityTemplateId
ID of the velocity template used when performing POST encoding. -
cspDigester
Digester for CSP hashes. -
cspNonceGenerator
Generator for CSP nonces.
-
-
Constructor Details
-
HTTPPostEncoder
public HTTPPostEncoder()Constructor.
-
-
Method Details
-
getBindingURI
Gets the SAML binding URI supported by this encoder.- Specified by:
getBindingURIin interfaceSAMLMessageEncoder- Returns:
- SAML binding URI supported by this encoder
-
getVelocityEngine
Get the VelocityEngine instance.- Returns:
- return the VelocityEngine instance
-
setVelocityEngine
public void setVelocityEngine(@Nullable org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.- Parameters:
newVelocityEngine- the new VelocityEngine instane
-
getVelocityTemplateId
Get the Velocity template id.Defaults to
DEFAULT_TEMPLATE_ID.- Returns:
- return the Velocity template id
-
setVelocityTemplateId
Set the Velocity template id.Defaults to
DEFAULT_TEMPLATE_ID.- Parameters:
newVelocityTemplateId- the new Velocity template id
-
doInitialize
- Overrides:
doInitializein classAbstractHttpServletResponseMessageEncoder- Throws:
ComponentInitializationException
-
doEncode
Performs the encoding logic. By the time this is called, this encoder has already been initialized and checked to ensure that it has not been destroyed.- Specified by:
doEncodein classAbstractMessageEncoder- Throws:
MessageEncodingException- thrown if there is a problem encoding the message
-
postEncode
protected void postEncode(@Nonnull MessageContext messageContext, @Nonnull String endpointURL) throws MessageEncodingException Base64 and POST encodes the outbound message and writes it to the outbound transport.- Parameters:
messageContext- current message contextendpointURL- endpoint URL to encode message to- Throws:
MessageEncodingException- thrown if there is a problem encoding the message
-