Class HTTPPostAuthnRequestEncoder
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.encoder.AbstractMessageEncoder
org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
net.shibboleth.oidc.profile.encoding.impl.AbstractOIDCMessageEncoder
net.shibboleth.oidc.profile.encoding.impl.HTTPPostAuthnRequestEncoder
- All Implemented Interfaces:
Predicate<OAuth2AuthorizationProfileConfiguration.HttpRequestMethod>,OIDCMessageEncoder,Component,DestructableComponent,InitializableComponent,UnmodifiableComponent,MessageEncoder,HttpServletResponseMessageEncoder
A
message encoder that encodes an OpenID authentication request by
HTTP Form POST Serialization.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringDigesterCSP digester for generating CSP hashes.private IdentifierGenerationStrategyCSP nonce generator.static final StringDefault template ID for using FORM POST request type.private final org.slf4j.LoggerClass logger.private org.apache.velocity.app.VelocityEngineVelocity engine used to evaluate the template when using FORM POST response mode.private StringID of the Velocity template used when using FORM POST response mode.Fields inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
BASE_PROTOCOL_MESSAGE_LOGGER_CATEGORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoEncode()private org.apache.velocity.VelocityContextdoPostEncode(OIDCAuthenticationRequest request, HttpServletResponse httpResponse) Construct form POST.voidsetCSPDigester(StringDigester digester) Sets aStringDigesterto use in computing CSP digests in views.voidSets anIdentifierGenerationStrategyto use in computing CSP nonces in views.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.voidsetVelocityTemplateId(String newVelocityTemplateId) Set the Velocity template id.booleantest(OAuth2AuthorizationProfileConfiguration.HttpRequestMethod requestMethod) Methods inherited from class net.shibboleth.oidc.profile.encoding.impl.AbstractOIDCMessageEncoder
createParametersFromRequest, serializeAuthorizationParamsToQueryString, serializeAuthorizationParamsToUrl, serializeMessageForLogging, setAuthorizationParamsAreValidPredicate, validateParamsMethods inherited from class org.opensaml.messaging.encoder.servlet.AbstractHttpServletResponseMessageEncoder
doInitialize, getHttpServletResponse, getHttpServletResponseSupplier, setHttpServletResponseSupplierMethods inherited from class org.opensaml.messaging.encoder.AbstractMessageEncoder
encode, 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 for using FORM POST request type.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
velocityEngine
@Nullable private org.apache.velocity.app.VelocityEngine velocityEngineVelocity engine used to evaluate the template when using FORM POST response mode. -
velocityTemplateId
ID of the Velocity template used when using FORM POST response mode. -
cspDigester
CSP digester for generating CSP hashes. -
cspNonceGenerator
CSP nonce generator.
-
-
Constructor Details
-
HTTPPostAuthnRequestEncoder
public HTTPPostAuthnRequestEncoder()
-
-
Method Details
-
setVelocityTemplateId
Set the Velocity template id.Defaults to
DEFAULT_TEMPLATE_ID.- Parameters:
newVelocityTemplateId- the new Velocity template id
-
setVelocityEngine
public void setVelocityEngine(@Nonnull org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.- Parameters:
newVelocityEngine- the new VelocityEngine instane
-
test
public boolean test(@Nullable OAuth2AuthorizationProfileConfiguration.HttpRequestMethod requestMethod) -
doPostEncode
private org.apache.velocity.VelocityContext doPostEncode(@Nonnull OIDCAuthenticationRequest request, @Nonnull HttpServletResponse httpResponse) throws MessageEncodingException Construct form POST.- Parameters:
request- the authentication request.httpResponse- the httpResponse.- Returns:
- response message as velocity context.
- Throws:
MessageEncodingException- on error building the parameters
-
doEncode
- Specified by:
doEncodein classAbstractMessageEncoder- Throws:
MessageEncodingException