Package net.shibboleth.idp.saml.saml2.profile.impl

# Class ProcessLogoutRequest

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.idp.saml.saml2.profile.impl.ProcessLogoutRequest

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class ProcessLogoutRequest extends AbstractProfileAction
Profile action that processes a `LogoutRequest` by resolving matching sessions, and destroys them, populating the associated `SPSession` objects (excepting the one initiating the logout) into a `LogoutContext`.

A `SubjectContext` is also populated. If and only if a single `IdPSession` is resolved, a `SessionContext` is also populated.

Each `SPSession` is also assigned a unique number and inserted into the map returned by `LogoutContext.getKeyedSessionMap()`.

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `EventIds.INVALID_MESSAGE`, `EventIds.IO_ERROR`, `SAMLEventIds.SESSION_NOT_FOUND`
Postcondition:
  If at least one `IdPSession` was found, then a `SubjectContext` and `LogoutContext` will be populated., If a single `IdPSession` was found, then a `SessionContext` will be populated.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`assertingParty`
Cached lookup of assertingParty name.
`private Function<ProfileRequestContext,String>`
`assertingPartyLookupStrategy`
Optional lookup function for obtaining default NameQualifier.
`private final org.slf4j.Logger`
`log`
Class logger.
`private Function<ProfileRequestContext,LogoutContext>`
`logoutContextCreationStrategy`
Creation/lookup function for LogoutContext.
`private LogoutRequest`
`logoutRequest`
LogoutRequest to process.
`private Function<ProfileRequestContext,LogoutRequest>`
`logoutRequestLookupStrategy`
Lookup strategy for `LogoutRequest` to process.
`private Set<String>`
`qualifiedNameIDFormats`
`NameID` Formats allowing defaulted qualifiers.
`private Function<ProfileRequestContext,Collection<String>>`
`qualifiedNameIDFormatsLookupStrategy`
Lookup strategy for obtaining qualifier-defaultable NameID Formats.
`private String`
`relyingParty`
Cached lookup of relyingParty name.
`private Function<ProfileRequestContext,String>`
`relyingPartyLookupStrategy`
Optional lookup function for obtaining default SPNameQualifier.
`private Function<ProfileRequestContext,SessionContext>`
`sessionContextCreationStrategy`
Creation/lookup function for SessionContext.
`private SessionResolver`
`sessionResolver`
Session resolver.
`private Function<ProfileRequestContext,CriteriaSet>`
`sessionResolverCriteriaStrategy`
Function to return `CriteriaSet` to give to session resolver.
`private Function<ProfileRequestContext,SubjectContext>`
`subjectContextCreationStrategy`
Creation/lookup function for SubjectContext.

## Constructor Summary

Constructors
Constructor
Description
`ProcessLogoutRequest()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected void`
`doInitialize()`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`private boolean`
`sessionMatches(ProfileRequestContext profileRequestContext, IdPSession session)`
Check if the session contains a `SAML2SPSession` with the appropriate service ID and SessionIndex.
`private boolean`
`sessionMatches(ProfileRequestContext profileRequestContext, SPSession session)`
Check if the `SPSession` has the appropriate service ID and SessionIndex.
`void`
`setAssertingPartyLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the lookup strategy to obtain the default IdP NameQualifier.
`void`
`setLogoutContextCreationStrategy(Function<ProfileRequestContext,LogoutContext> strategy)`
Set the creation/lookup strategy for the `LogoutContext` to populate.
`void`
`setLogoutRequestLookupStrategy(Function<ProfileRequestContext,LogoutRequest> strategy)`
Set the lookup strategy for the `LogoutRequest` to process.
`void`
`setQualifiedNameIDFormatsLookupStrategy(Function<ProfileRequestContext,Collection<String>> strategy)`
Set the lookup strategy for the `NameID` Formats to allow defaulted qualifiers.
`void`
`setRelyingPartyLookupStrategy(Function<ProfileRequestContext,String> strategy)`
Set the lookup strategy to obtain the default SPNameQualifier.
`void`
`setSessionContextCreationStrategy(Function<ProfileRequestContext,SessionContext> strategy)`
Set the creation/lookup strategy for the `SessionContext` to populate.
`void`
`setSessionResolver(SessionResolver resolver)`
Set the `SessionResolver` to use.
`void`
`setSessionResolverCriteriaStrategy(Function<ProfileRequestContext,CriteriaSet> strategy)`
Set the strategy for building the `CriteriaSet` to feed into the `SessionResolver`.
`void`
`setSubjectContextCreationStrategy(Function<ProfileRequestContext,SubjectContext> strategy)`
Set the creation/lookup strategy for the `SubjectContext` to populate.

### Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

`doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, 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, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### sessionResolver

@NonnullAfterInit private SessionResolver sessionResolver
Session resolver.

### subjectContextCreationStrategy

@Nonnull private Function<ProfileRequestContext,SubjectContext> subjectContextCreationStrategy
Creation/lookup function for SubjectContext.

### sessionContextCreationStrategy

@Nonnull private Function<ProfileRequestContext,SessionContext> sessionContextCreationStrategy
Creation/lookup function for SessionContext.

### logoutContextCreationStrategy

@Nonnull private Function<ProfileRequestContext,LogoutContext> logoutContextCreationStrategy
Creation/lookup function for LogoutContext.

### sessionResolverCriteriaStrategy

@Nonnull private Function<ProfileRequestContext,CriteriaSet> sessionResolverCriteriaStrategy
Function to return `CriteriaSet` to give to session resolver.

### logoutRequestLookupStrategy

@Nonnull private Function<ProfileRequestContext,LogoutRequest> logoutRequestLookupStrategy
Lookup strategy for `LogoutRequest` to process.

### qualifiedNameIDFormatsLookupStrategy

@Nonnull private Function<ProfileRequestContext,Collection<String>> qualifiedNameIDFormatsLookupStrategy
Lookup strategy for obtaining qualifier-defaultable NameID Formats.

### assertingPartyLookupStrategy

@Nullable private Function<ProfileRequestContext,String> assertingPartyLookupStrategy
Optional lookup function for obtaining default NameQualifier.

### relyingPartyLookupStrategy

@Nullable private Function<ProfileRequestContext,String> relyingPartyLookupStrategy
Optional lookup function for obtaining default SPNameQualifier.

### logoutRequest

@NonnullBeforeExec private LogoutRequest logoutRequest
LogoutRequest to process.

### qualifiedNameIDFormats

@Nonnull private Set<String> qualifiedNameIDFormats
`NameID` Formats allowing defaulted qualifiers.

### assertingParty

@Nullable private String assertingParty
Cached lookup of assertingParty name.

### relyingParty

@Nullable private String relyingParty
Cached lookup of relyingParty name.

## Constructor Details

### ProcessLogoutRequest

public ProcessLogoutRequest()
Constructor.

## Method Details

### setSessionResolver

public void setSessionResolver(@Nonnull SessionResolver resolver)
Set the `SessionResolver` to use.

Parameters:
  `resolver` - session resolver to use

### setSubjectContextCreationStrategy

public void setSubjectContextCreationStrategy(@Nonnull Function<ProfileRequestContext,SubjectContext> strategy)
Set the creation/lookup strategy for the `SubjectContext` to populate.

Parameters:
  `strategy` - creation/lookup strategy

### setSessionContextCreationStrategy

public void setSessionContextCreationStrategy(@Nonnull Function<ProfileRequestContext,SessionContext> strategy)
Set the creation/lookup strategy for the `SessionContext` to populate.

Parameters:
  `strategy` - creation/lookup strategy

### setLogoutContextCreationStrategy

public void setLogoutContextCreationStrategy(@Nonnull Function<ProfileRequestContext,LogoutContext> strategy)
Set the creation/lookup strategy for the `LogoutContext` to populate.

Parameters:
  `strategy` - creation/lookup strategy

### setSessionResolverCriteriaStrategy

public void setSessionResolverCriteriaStrategy(@Nonnull Function<ProfileRequestContext,CriteriaSet> strategy)
Set the strategy for building the `CriteriaSet` to feed into the `SessionResolver`.

Parameters:
  `strategy` - building strategy

### setLogoutRequestLookupStrategy

public void setLogoutRequestLookupStrategy(@Nonnull Function<ProfileRequestContext,LogoutRequest> strategy)
Set the lookup strategy for the `LogoutRequest` to process.

Parameters:
  `strategy` - lookup strategy

### setQualifiedNameIDFormatsLookupStrategy

public void setQualifiedNameIDFormatsLookupStrategy(@Nonnull Function<ProfileRequestContext,Collection<String>> strategy)
Set the lookup strategy for the `NameID` Formats to allow defaulted qualifiers.

Parameters:
  `strategy` - lookup strategy
Since:
  3.4.0

### setAssertingPartyLookupStrategy

public void setAssertingPartyLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
Set the lookup strategy to obtain the default IdP NameQualifier.

Parameters:
  `strategy` - lookup strategy
Since:
  3.4.0

### setRelyingPartyLookupStrategy

public void setRelyingPartyLookupStrategy(@Nullable Function<ProfileRequestContext,String> strategy)
Set the lookup strategy to obtain the default SPNameQualifier.

Parameters:
  `strategy` - lookup strategy
Since:
  3.4.0

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### sessionMatches

private boolean sessionMatches(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull IdPSession session)
Check if the session contains a `SAML2SPSession` with the appropriate service ID and SessionIndex.

Parameters:
  `profileRequestContext` - current profile request context
  `session` - `IdPSession` to check
Returns:
  true iff the set of `SPSession`s includes one applicable to the logout request

### sessionMatches

private boolean sessionMatches(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull SPSession session)
Check if the `SPSession` has the appropriate service ID and SessionIndex.

Parameters:
  `profileRequestContext` - current profile request context
  `session` - `SPSession` to check
Returns:
  true iff the `SPSession` directly matches the logout request