public class HTTPArtifactEncoder extends BaseSAML2MessageEncoder
| Modifier and Type | Field and Description |
|---|---|
private SAMLArtifactMap |
artifactMap
SAML artifact map used to store created artifacts for later retrieval.
|
static String |
DEFAULT_TEMPLATE_ID
Default template ID.
|
private byte[] |
defaultArtifactType
Default artifact type to use when encoding messages.
|
private org.slf4j.Logger |
log
Class logger.
|
private boolean |
postEncoding
Whether the POST encoding should be used, instead of GET.
|
private VelocityEngine |
velocityEngine
Velocity engine used to evaluate the template when performing POST encoding.
|
private String |
velocityTemplateId
ID of the velocity template used when performing POST encoding.
|
| Constructor and Description |
|---|
HTTPArtifactEncoder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected AbstractSAML2Artifact |
buildArtifact(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Builds the SAML 2 artifact for the outgoing message.
|
protected void |
doDestroy() |
protected void |
doEncode() |
protected void |
doInitialize() |
SAMLArtifactMap |
getArtifactMap()
Get the SAML artifact map to use.
|
String |
getBindingURI() |
protected void |
getEncode()
Performs HTTP GET based encoding.
|
private String |
getInboundMessageIssuer(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Get the requester.
|
private String |
getOutboundMessageIssuer(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Get the outbound message issuer.
|
private byte[] |
getSAMLArtifactType(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
Get the SAML artifact type from the message context.
|
VelocityEngine |
getVelocityEngine()
Get the VelocityEngine instance.
|
String |
getVelocityTemplateId()
Get the Velocity template id.
|
boolean |
isPostEncoding()
Get whether the encoder will encode the artifact via POST encoding.
|
protected void |
postEncode()
Performs HTTP POST based encoding.
|
void |
setArtifactMap(SAMLArtifactMap newArtifactMap)
Set the SAML artifact map to use.
|
void |
setPostEncoding(boolean post)
Set whether the encoder will encode the artifact via POST encoding.
|
void |
setVelocityEngine(VelocityEngine newVelocityEngine)
Set the VelocityEngine instance.
|
void |
setVelocityTemplateId(String newVelocityTemplateId)
Set the Velocity template id.
|
private void |
storeSAMLArtifactType(org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext,
byte[] artifactType)
Store the SAML artifact type in the message context.
|
getEndpointURLencode, getMessageToLog, logEncodedMessage, marshallMessagegetHttpServletResponse, setHttpServletResponsegetMessageContext, prepareContext, setMessageContextdestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitencode, prepareContext, setMessageContextinitialize, isInitializeddestroy, isDestroyed@Nonnull @NotEmpty public static final String DEFAULT_TEMPLATE_ID
@Nonnull private final org.slf4j.Logger log
private boolean postEncoding
@Nullable private VelocityEngine velocityEngine
@Nonnull @NotEmpty private String velocityTemplateId
@NonnullAfterInit private SAMLArtifactMap artifactMap
public String getBindingURI()
public boolean isPostEncoding()
public void setPostEncoding(boolean post)
post - true if POST encoding will be used, false if GET encoding will be used@Nullable public VelocityEngine getVelocityEngine()
public void setVelocityEngine(@Nullable VelocityEngine newVelocityEngine)
newVelocityEngine - the new VelocityEngine instane@Nonnull @NotEmpty public String getVelocityTemplateId()
Defaults to DEFAULT_TEMPLATE_ID.
public void setVelocityTemplateId(@Nonnull @NotEmpty String newVelocityTemplateId)
Defaults to DEFAULT_TEMPLATE_ID.
newVelocityTemplateId - the new Velocity template id@NonnullAfterInit public SAMLArtifactMap getArtifactMap()
public void setArtifactMap(@Nonnull SAMLArtifactMap newArtifactMap)
newArtifactMap - the new artifactMapprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder<SAMLObject>ComponentInitializationExceptionprotected void doDestroy()
doDestroy in class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder<SAMLObject>protected void doEncode()
throws org.opensaml.messaging.encoder.MessageEncodingException
doEncode in class org.opensaml.messaging.encoder.AbstractMessageEncoder<SAMLObject>org.opensaml.messaging.encoder.MessageEncodingExceptionprotected void postEncode()
throws org.opensaml.messaging.encoder.MessageEncodingException
org.opensaml.messaging.encoder.MessageEncodingException - thrown if there is a problem POST encoding the artifactprotected void getEncode()
throws org.opensaml.messaging.encoder.MessageEncodingException
org.opensaml.messaging.encoder.MessageEncodingException - thrown if there is a problem GET encoding the artifact@Nonnull protected AbstractSAML2Artifact buildArtifact(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext) throws org.opensaml.messaging.encoder.MessageEncodingException
messageContext - current request contextorg.opensaml.messaging.encoder.MessageEncodingException - thrown if the artifact can not be created@Nullable private String getOutboundMessageIssuer(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
messageContext - the message context@Nullable private String getInboundMessageIssuer(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
messageContext - the message contextprivate void storeSAMLArtifactType(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext, @Nonnull @NotEmpty byte[] artifactType)
messageContext - the message contextartifactType - the artifact type to store@Nullable private byte[] getSAMLArtifactType(@Nonnull org.opensaml.messaging.context.MessageContext<SAMLObject> messageContext)
messageContext - the message contextCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.