Package net.shibboleth.idp.session.impl
Class PopulateLogoutPropagationContext
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.profile.action.AbstractProfileAction
-
- org.opensaml.profile.action.AbstractConditionalProfileAction
-
- net.shibboleth.idp.profile.AbstractProfileAction
-
- net.shibboleth.idp.session.impl.PopulateLogoutPropagationContext
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class PopulateLogoutPropagationContext extends AbstractProfileAction
Profile action that creates aLogoutPropagationContextcontainingSPSessionto be destroyed. The SP sessions may be populated:- By reference - via SessionKey request parameter that looks up one
SPSessionfrom aLogoutContextstored in the HTTP session. - By value - reconstitutes an encrypted
SPSessionobject in SPSession request parameter. - By lookup strategy.
- Event:
- SessionNotFound,
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX,EventIds.UNABLE_TO_DECODE - Postcondition:
- If an
SPSessionis found, then aLogoutPropagationContextwill be populated.
-
-
Field Summary
Fields Modifier and Type Field Description private Function<ProfileRequestContext,LogoutPropagationContext>contextCreationStrategyLookup/creation function for LogoutPropagationContext.private DataSealerdataSealerDataSealerto use.private org.slf4j.LoggerlogClass logger.private SPSessionsessionSPSessionto operate on.private static StringSESSION_NOT_FOUNDName of parameter containing session by reference.private static StringSESSION_PARAM_BYREFName of parameter containing session by reference.private static StringSESSION_PARAM_BYVALName of parameter containing session by value.private StringsessionKeyThe value used to look up a session by reference.private Function<ProfileRequestContext,SPSession>sessionLookupStrategyLookup strategy for session.private SPSessionSerializerRegistryspSessionSerializerRegistryMappings between a SPSession type and a serializer implementation.
-
Constructor Summary
Constructors Constructor Description PopulateLogoutPropagationContext()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext)private SPSessiongetSessionByReference(RequestContext requestContext, String key)Get anSPSessionby reference.private SPSessiongetSessionByValue(String sessionVal)Get anSPSessionby value.voidsetDataSealer(DataSealer sealer)Set theDataSealerto use.voidsetLogoutPropagationContextCreationStrategy(Function<ProfileRequestContext,LogoutPropagationContext> strategy)Set the creation/lookup strategy for theLogoutPropagationContext.voidsetSessionLookupStrategy(Function<ProfileRequestContext,SPSession> strategy)Set a lookup strategy to use to obtain the session to populate.voidsetSPSessionSerializerRegistry(SPSessionSerializerRegistry registry)Set theSPSessionSerializerRegistryto use.-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, 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.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
SESSION_NOT_FOUND
@Nonnull @NotEmpty private static final String SESSION_NOT_FOUND
Name of parameter containing session by reference.- See Also:
- Constant Field Values
-
SESSION_PARAM_BYREF
@Nonnull @NotEmpty private static final String SESSION_PARAM_BYREF
Name of parameter containing session by reference.- See Also:
- Constant Field Values
-
SESSION_PARAM_BYVAL
@Nonnull @NotEmpty private static final String SESSION_PARAM_BYVAL
Name of parameter containing session by value.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
dataSealer
@Nullable private DataSealer dataSealer
DataSealerto use.
-
spSessionSerializerRegistry
@Nullable private SPSessionSerializerRegistry spSessionSerializerRegistry
Mappings between a SPSession type and a serializer implementation.
-
contextCreationStrategy
@Nonnull private Function<ProfileRequestContext,LogoutPropagationContext> contextCreationStrategy
Lookup/creation function for LogoutPropagationContext.
-
sessionLookupStrategy
@Nullable private Function<ProfileRequestContext,SPSession> sessionLookupStrategy
Lookup strategy for session.
-
sessionKey
@Nullable private String sessionKey
The value used to look up a session by reference.
-
-
Method Detail
-
setDataSealer
public void setDataSealer(@Nullable DataSealer sealer)Set theDataSealerto use.- Parameters:
sealer- theDataSealerto use
-
setSPSessionSerializerRegistry
public void setSPSessionSerializerRegistry(@Nullable SPSessionSerializerRegistry registry)Set theSPSessionSerializerRegistryto use.- Parameters:
registry- a registry of SPSession class to serializer mappings
-
setLogoutPropagationContextCreationStrategy
public void setLogoutPropagationContextCreationStrategy(@Nonnull Function<ProfileRequestContext,LogoutPropagationContext> strategy)Set the creation/lookup strategy for theLogoutPropagationContext.- Parameters:
strategy- creation/lookup strategy
-
setSessionLookupStrategy
public void setSessionLookupStrategy(@Nullable Function<ProfileRequestContext,SPSession> strategy)Set a lookup strategy to use to obtain the session to populate.- Parameters:
strategy- lookup strategy
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)- Overrides:
doExecutein classAbstractProfileAction
-
getSessionByReference
@Nonnull private SPSession getSessionByReference(@Nonnull RequestContext requestContext, @Nonnull String key) throws MessageException
Get anSPSessionby reference.- Parameters:
requestContext- Spring request contextkey- session key identifying the SP session- Returns:
- the SP session
- Throws:
MessageException- if an error occurs
-
getSessionByValue
@Nonnull private SPSession getSessionByValue(@Nonnull String sessionVal) throws MessageDecodingException
Get anSPSessionby value.- Parameters:
sessionVal- serialized SP session- Returns:
- the SP session
- Throws:
MessageDecodingException- if an error occurs
-
-