Package net.shibboleth.sp.profile.impl
Class RecoverPostData
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.sp.profile.AbstractAgentRequestAction
net.shibboleth.sp.profile.AbstractAgentAction
net.shibboleth.sp.profile.AbstractApplicationAction
net.shibboleth.sp.profile.impl.RecoverPostData
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that detects submitted form data, and when permitted, stores it in a
StorageService and
issues a cookie associated with the active state token to preserve a pointer to the data for recovery.- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_MESSAGE,EventIds.INVALID_PROFILE_CTX,EventIds.IO_ERROR- Precondition:
AgentRequestContext.getOutput().isstruct()
,AgentRequestContext.getRemotedServletResponse() != null
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CookieManagerCookie manager.private StringCookie prefix.private StringDigesterDigester for CSP hashes.private IdentifierGenerationStrategyCSP nonce generation.private CharsetDecoderDeecoder for Agent data.static final StringDefault cookie prefix.static final StringDefault template ID.private org.slf4j.LoggerClass logger.private StringRecovered data.(package private) byte[]Target of POST.Strategy used to locate theStateDataContextto pull target from.private StorageServiceStorage service for data.private org.apache.velocity.app.VelocityEngineVelocity engine used to evaluate the replay form template.private StringID of the velocity template used to generate replay form. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) private StringChecks for stored data based on the state token and cookie(s) supplied and reads back from storage, deleting the record.voidsetCookieManager(CookieManager manager) Sets theCookieManagerto use.voidsetCookiePrefix(String prefix) Sets the cookie prefix.voidsetCSPDigester(StringDigester digester) Set aStringDigesterto use to generate CSP hashes.voidSetIdentifierGenerationStrategyto use for generating CSP nonces.voidSets the strategy used to lookup theStateDataContext.voidsetStorageService(StorageService storage) SetStorageServiceto use.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.voidsetVelocityTemplateId(String newVelocityTemplateId) Set the Velocity template ID.Methods inherited from class net.shibboleth.sp.profile.AbstractApplicationAction
ensureApplication, getApplicationMethods inherited from class net.shibboleth.sp.profile.AbstractAgentAction
ensureAgent, getAgentMethods inherited from class net.shibboleth.sp.profile.AbstractAgentRequestAction
ensureAgentRequestContext, getAgentRequestContext, setAgentRequestContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods 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.InitializableComponent
initialize, isInitialized
-
Field Details
-
DEFAULT_TEMPLATE_ID
Default template ID.- See Also:
-
DEFAULT_COOKIE_PREFIX
Default cookie prefix.- See Also:
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
velocityEngine
Velocity engine used to evaluate the replay form template. -
velocityTemplateId
ID of the velocity template used to generate replay form. -
cspDigester
Digester for CSP hashes. -
cspNonceGenerator
CSP nonce generation. -
storageService
Storage service for data. -
cookieManager
Cookie manager. -
cookiePrefix
Cookie prefix. -
stateDataContextLookupStrategy
Strategy used to locate theStateDataContextto pull target from. -
decoder
Deecoder for Agent data. -
postData
Recovered data. -
resource
Target of POST.
-
-
Constructor Details
-
RecoverPostData
public RecoverPostData()Constructor.
-
-
Method Details
-
setVelocityEngine
public void setVelocityEngine(@Nullable org.apache.velocity.app.VelocityEngine newVelocityEngine) Set the VelocityEngine instance.- Parameters:
newVelocityEngine- the new VelocityEngine instane
-
setVelocityTemplateId
Set the Velocity template ID.Defaults to
DEFAULT_TEMPLATE_ID.- Parameters:
newVelocityTemplateId- the new Velocity template id
-
setStorageService
SetStorageServiceto use.- Parameters:
storage- storage service
-
setCookiePrefix
Sets the cookie prefix.Defaults to
DEFAULT_COOKIE_PREFIX.- Parameters:
prefix- cookie prefix
-
setStateDataContextLookupStrategy
public void setStateDataContextLookupStrategy(@Nonnull Function<ProfileRequestContext, StateDataContext> strategy) Sets the strategy used to lookup theStateDataContext.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractApplicationAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
getRecoveredData
Checks for stored data based on the state token and cookie(s) supplied and reads back from storage, deleting the record.Errors here are logged and suppressed since there's nothing to be done about them.
- Returns:
- recovered data, if any
-