Class ProcessEndUserClaims
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.oidc.profile.impl.ProcessEndUserClaims
- All Implemented Interfaces:
net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.InitializableComponent,org.opensaml.profile.action.ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class ProcessEndUserClaims
extends net.shibboleth.idp.profile.AbstractProfileAction
Process the end-user claims from the id_token and possible UserInfo claims sets.
Sanitized both claims sets using a replaceable strategy. For example, by default to remove standard JWT 'validation' claims that should not be exposed further by the system.
Merge the claims sets together to produce an aggregate claims set. The UserInfo claims can be empty i.e. claims from the UserInfo endpoint were not requested.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX- Postcondition:
- Add a set of merged and sanatized claims to the
EndUserClaimsContext.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.AccessTokenResponseContext> Strategy used to look up theAccessTokenResponseContext.private BinaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet>The strategy used to merge UserInfo claims with id_token claims.private UnaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet>The strategy used to sanitize claims in an input claimset.private Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.EndUserClaimsContext> Strategy used to look up theEndUserClaimsContextto set the parameters for.private com.nimbusds.jwt.JWTClaimsSetThe stashed id_token claims.private final org.slf4j.LoggerClass logger.private com.nimbusds.openid.connect.sdk.claims.ClaimsSetThe stashed UserInfo claims.private Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.UserInfoResponseContext> Strategy used to look up theUserInfoResponseContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext) voidsetAccessTokenResponseContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.AccessTokenResponseContext> strategy) Set the strategy used to look up aAccessTokenResponseContext.voidsetClaimMergingStrategy(BinaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> strategy) Set the strategy used to merge UserInfo claims with id_token claims.voidsetClaimSanitizationStrategy(UnaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> strategy) Set the strategy used to sanitize claims from both the id_token and UserInfo claims set to produce a clean claims set.voidsetEnableClaimSanitizationStrategy(boolean enable) Set whether to enable claim sanitization.voidsetEndUserClaimsContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.EndUserClaimsContext> strategy) Set the strategy used to lookup aEndUserClaimsContext.voidsetUserInfoResponseContextLookupStrategy(Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.UserInfoResponseContext> strategy) Set the strategy used to look up aUserInfoResponseContext.Methods 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
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
userInfoResponseContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.UserInfoResponseContext> userInfoResponseContextLookupStrategyStrategy used to look up theUserInfoResponseContext. -
accessTokenResponseContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.AccessTokenResponseContext> accessTokenResponseContextLookupStrategyStrategy used to look up theAccessTokenResponseContext. -
endUserClaimsContextLookupStrategy
@Nonnull private Function<org.opensaml.profile.context.ProfileRequestContext,net.shibboleth.oidc.profile.context.EndUserClaimsContext> endUserClaimsContextLookupStrategyStrategy used to look up theEndUserClaimsContextto set the parameters for. -
claimMergingStrategy
@NonnullAfterInit private BinaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> claimMergingStrategyThe strategy used to merge UserInfo claims with id_token claims. -
claimSanitizationStrategy
@NonnullAfterInit private UnaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> claimSanitizationStrategyThe strategy used to sanitize claims in an input claimset. By default, produces a set of claims without the validation claims (e.g. nonce, exp), but leaving the identity, authorization and misc claims. -
userInfoClaims
@NonnullBeforeExec private com.nimbusds.openid.connect.sdk.claims.ClaimsSet userInfoClaimsThe stashed UserInfo claims. This is allowably empty if the UserInfo endpoint was not used. -
idTokenClaims
@NonnullBeforeExec private com.nimbusds.jwt.JWTClaimsSet idTokenClaimsThe stashed id_token claims. This should never be null or empty oncedoPreExecute(ProfileRequestContext)has run.
-
-
Constructor Details
-
ProcessEndUserClaims
public ProcessEndUserClaims()Constructor.
-
-
Method Details
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.shared.component.AbstractInitializableComponent- Throws:
net.shibboleth.shared.component.ComponentInitializationException
-
setClaimMergingStrategy
public void setClaimMergingStrategy(@Nonnull BinaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> strategy) Set the strategy used to merge UserInfo claims with id_token claims.- Parameters:
strategy- the strategy to use.
-
setClaimSanitizationStrategy
public void setClaimSanitizationStrategy(@Nonnull UnaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> strategy) Set the strategy used to sanitize claims from both the id_token and UserInfo claims set to produce a clean claims set.- Parameters:
strategy- the strategy to use.
-
setEnableClaimSanitizationStrategy
public void setEnableClaimSanitizationStrategy(boolean enable) Set whether to enable claim sanitization. If true, whatever claimSanatizationStrategy is set is used. If false, a no-op strategy is created which just returns a new claims set based on the same claims that exist in the input claims set. By default, the input set of claims are added to the result set.- Parameters:
enable- enable or disable claims sanitization
-
setEndUserClaimsContextLookupStrategy
public void setEndUserClaimsContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.EndUserClaimsContext> strategy) Set the strategy used to lookup aEndUserClaimsContext.- Parameters:
strategy- the strategy
-
setAccessTokenResponseContextLookupStrategy
public void setAccessTokenResponseContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.AccessTokenResponseContext> strategy) Set the strategy used to look up aAccessTokenResponseContext.- Parameters:
strategy- lookup strategy
-
setUserInfoResponseContextLookupStrategy
public void setUserInfoResponseContextLookupStrategy(@Nonnull Function<org.opensaml.profile.context.ProfileRequestContext, net.shibboleth.oidc.profile.context.UserInfoResponseContext> strategy) Set the strategy used to look up aUserInfoResponseContext.- Parameters:
strategy- lookup strategy
-
doPreExecute
protected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext) - Overrides:
doPreExecutein classorg.opensaml.profile.action.AbstractConditionalProfileAction
-
doExecute
protected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext) - Overrides:
doExecutein classorg.opensaml.profile.action.AbstractProfileAction
-