Class OIDCRPSessionCreationStrategy

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.oidc.op.session.impl.OIDCRPSessionCreationStrategy
All Implemented Interfaces:
Function<ProfileRequestContext,SPSession>, Component, DestructableComponent, InitializableComponent

public class OIDCRPSessionCreationStrategy extends AbstractInitializableComponent implements Function<ProfileRequestContext,SPSession>
A function to create a OIDCRPSession based on profile execution state.
  • Field Details

    • log

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

      @Nonnull private final Duration sessionLifetime
      Lifetime of sessions to create.
    • oidcMetadataContextLookupStrategy

      @Nonnull private Function<ProfileRequestContext,OIDCMetadataContext> oidcMetadataContextLookupStrategy
      Lookup strategy for OIDC metadata context.
    • oidcResponseContextLookupStrategy

      @Nonnull private Function<ProfileRequestContext,OIDCAuthenticationResponseContext> oidcResponseContextLookupStrategy
      Lookup strategy for OIDC authentication response context.
    • clientIDLookupStrategy

      @Nonnull private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.id.ClientID> clientIDLookupStrategy
      Lookup strategy used to obtain the client id value.
  • Constructor Details

    • OIDCRPSessionCreationStrategy

      public OIDCRPSessionCreationStrategy(@Nonnull Duration lifetime)
      Constructor.
      Parameters:
      lifetime - determines upper bound for expiration of OIDCRPSession to be created
  • Method Details

    • setOidcMetadataContextLookupStrategy

      public void setOidcMetadataContextLookupStrategy(@Nonnull Function<ProfileRequestContext,OIDCMetadataContext> strategy)
      Set the lookup strategy for OIDC metadata context.
      Parameters:
      strategy - lookup strategy
    • setOidcResponseContextLookupStrategy

      public void setOidcResponseContextLookupStrategy(@Nonnull Function<ProfileRequestContext,OIDCAuthenticationResponseContext> strategy)
      Set the lookup strategy for OIDC authentication response context.
      Parameters:
      strategy - lookup strategy
    • setClientIDLookupStrategy

      public void setClientIDLookupStrategy(@Nonnull Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.id.ClientID> strategy)
      Set the lookup strategy used to obtain the client id value.
      Parameters:
      strategy - lookup strategy
    • apply

      @Nullable public SPSession apply(@Nullable ProfileRequestContext profileRequestContext)
      Specified by:
      apply in interface Function<ProfileRequestContext,SPSession>
    • getSessionIdentifier

      @Nullable protected String getSessionIdentifier(@Nullable TokenClaimsSet tokenClaimsSet, @Nullable com.nimbusds.openid.connect.sdk.claims.IDTokenClaimsSet idTokenClaimsSet)
      Get session identifier from the given token claims set if found, and from the given ID token claims set if not.
      Parameters:
      tokenClaimsSet - token claims set used as a primary source
      idTokenClaimsSet - ID token claims set used as a secondary source
      Returns:
      session identifier value, or null if not found from neither of the sources
    • getIssuer

      @Nullable protected String getIssuer(@Nullable TokenClaimsSet tokenClaimsSet, @Nullable com.nimbusds.openid.connect.sdk.claims.IDTokenClaimsSet idTokenClaimsSet)
      Get issuer from the given token claims set if found, and from the given ID token claims set if not.
      Parameters:
      tokenClaimsSet - token claims set used as a primary source
      idTokenClaimsSet - ID token claims set used as a secondary source
      Returns:
      issuer value, or null if not found from neither of the sources
    • getSubject

      @Nullable protected String getSubject(@Nullable TokenClaimsSet tokenClaimsSet, @Nullable com.nimbusds.openid.connect.sdk.claims.IDTokenClaimsSet idTokenClaimsSet)
      Get subject from the given token claims set if found, and from the given ID token claims set if not.
      Parameters:
      tokenClaimsSet - token claims set used as a primary source
      idTokenClaimsSet - ID token claims set used as a secondary source
      Returns:
      subject value, or null if not found from neither of the sources
    • isSupportsLogoutPropagation

      protected boolean isSupportsLogoutPropagation(@Nullable ProfileRequestContext profileRequestContext)
      Check if the OIDCClientMetadata attached to the given PRC contains a front- or back-channel logout URI.
      Parameters:
      profileRequestContext - The profile request context
      Returns:
      true iff the attached metadata contains a front- or back-channel logout URI