Class NimbusResponseEncoder
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.encoder.AbstractMessageEncoder
-
- org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
-
- net.shibboleth.idp.plugin.oidc.op.encoding.impl.NimbusResponseEncoder
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,MessageEncoder,HttpServletResponseMessageEncoder
public class NimbusResponseEncoder extends AbstractHttpServletResponseMessageEncoder
A message encodes that encodes the NimbusResponsein the message context inside the attachedHttpServletResponse.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TEMPLATE_IDDefault template ID for using FORM POST response mode.private org.slf4j.LoggerlogClass logger.private org.slf4j.LoggerprotocolMessageLogUsed to log protocol messages.private org.apache.velocity.app.VelocityEnginevelocityEngineVelocity engine used to evaluate the template when using FORM POST response mode.private StringvelocityTemplateIdID of the Velocity template used when using FORM POST response mode.
-
Constructor Summary
Constructors Constructor Description NimbusResponseEncoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoEncode()private org.apache.velocity.VelocityContextdoPostEncode(com.nimbusds.oauth2.sdk.AuthorizationResponse message)Set response message to FORM POST velocity context.private booleanimpliesFormPost(Object response)Whether we should use FORM POST response encoding.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.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
doDestroy, doInitialize, getHttpServletResponse, setHttpServletResponse
-
Methods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
encode, getMessageContext, prepareContext, setMessageContext
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.DestructableComponent
destroy, isDestroyed
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Methods inherited from interface org.opensaml.messaging.encoder.MessageEncoder
encode, prepareContext, setMessageContext
-
-
-
-
Field Detail
-
DEFAULT_TEMPLATE_ID
@Nonnull @NotEmpty public static final String DEFAULT_TEMPLATE_ID
Default template ID for using FORM POST response mode.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
protocolMessageLog
@Nonnull private final org.slf4j.Logger protocolMessageLog
Used to log protocol messages.
-
velocityEngine
@Nullable private org.apache.velocity.app.VelocityEngine velocityEngine
Velocity engine used to evaluate the template when using FORM POST response mode.
-
-
Method Detail
-
setVelocityTemplateId
public void setVelocityTemplateId(String newVelocityTemplateId)
Set the Velocity template id.Defaults to
DEFAULT_TEMPLATE_ID.- Parameters:
newVelocityTemplateId- the new Velocity template id
-
setVelocityEngine
public void setVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine)
Set the VelocityEngine instance.- Parameters:
newVelocityEngine- the new VelocityEngine instane
-
impliesFormPost
private boolean impliesFormPost(@Nullable Object response)Whether we should use FORM POST response encoding.- Parameters:
response- response message.- Returns:
- true if DORM POST should be used.
-
doPostEncode
private org.apache.velocity.VelocityContext doPostEncode(@Nonnull com.nimbusds.oauth2.sdk.AuthorizationResponse message)Set response message to FORM POST velocity context.- Parameters:
message- response message.- Returns:
- response message as velocity context.
-
doEncode
protected void doEncode() throws MessageEncodingException- Specified by:
doEncodein classAbstractMessageEncoder- Throws:
MessageEncodingException
-
-