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 Summary
FieldsModifier and TypeFieldDescriptionprivate Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.id.ClientID> Lookup strategy used to obtain the client id value.private final org.slf4j.LoggerClass logger.Lookup strategy for OIDC metadata context.Lookup strategy for OIDC authentication response context.private final DurationLifetime of sessions to create. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(ProfileRequestContext profileRequestContext) protected StringgetIssuer(TokenClaimsSet tokenClaimsSet, 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.protected StringgetSessionIdentifier(TokenClaimsSet tokenClaimsSet, 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.protected StringgetSubject(TokenClaimsSet tokenClaimsSet, 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.protected booleanisSupportsLogoutPropagation(ProfileRequestContext profileRequestContext) Check if theOIDCClientMetadataattached to the given PRC contains a front- or back-channel logout URI.voidsetClientIDLookupStrategy(Function<ProfileRequestContext, com.nimbusds.oauth2.sdk.id.ClientID> strategy) Set the lookup strategy used to obtain the client id value.voidSet the lookup strategy for OIDC metadata context.voidsetOidcResponseContextLookupStrategy(Function<ProfileRequestContext, OIDCAuthenticationResponseContext> strategy) Set the lookup strategy for OIDC authentication response context.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
sessionLifetime
Lifetime of sessions to create. -
oidcMetadataContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCMetadataContext> oidcMetadataContextLookupStrategyLookup strategy for OIDC metadata context. -
oidcResponseContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCAuthenticationResponseContext> oidcResponseContextLookupStrategyLookup strategy for OIDC authentication response context. -
clientIDLookupStrategy
@Nonnull private Function<ProfileRequestContext,com.nimbusds.oauth2.sdk.id.ClientID> clientIDLookupStrategyLookup strategy used to obtain the client id value.
-
-
Constructor Details
-
OIDCRPSessionCreationStrategy
Constructor.- Parameters:
lifetime- determines upper bound for expiration ofOIDCRPSessionto 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
- Specified by:
applyin interfaceFunction<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 sourceidTokenClaimsSet- 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 sourceidTokenClaimsSet- 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 sourceidTokenClaimsSet- 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 theOIDCClientMetadataattached 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
-