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.idp.authn.AbstractAuthenticationAction
net.shibboleth.idp.plugin.authn.oidc.rp.impl.ProcessEndUserClaims
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
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 TypeFieldDescriptionStrategy 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.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.Strategy used to look up theUserInfoResponseContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) voidsetAccessTokenResponseContextLookupStrategy(Function<ProfileRequestContext, 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<ProfileRequestContext, EndUserClaimsContext> strategy) Set the strategy used to lookup aEndUserClaimsContext.voidsetUserInfoResponseContextLookupStrategy(Function<ProfileRequestContext, UserInfoResponseContext> strategy) Set the strategy used to look up aUserInfoResponseContext.Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, setAuthenticationContextLookupStrategyMethods 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, doInitialize, 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<ProfileRequestContext,UserInfoResponseContext> userInfoResponseContextLookupStrategyStrategy used to look up theUserInfoResponseContext. -
accessTokenResponseContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,AccessTokenResponseContext> accessTokenResponseContextLookupStrategyStrategy used to look up theAccessTokenResponseContext. -
endUserClaimsContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,EndUserClaimsContext> endUserClaimsContextLookupStrategyStrategy used to look up theEndUserClaimsContextto set the parameters for. -
claimMergingStrategy
@Nonnull private BinaryOperator<com.nimbusds.openid.connect.sdk.claims.ClaimsSet> claimMergingStrategyThe strategy used to merge UserInfo claims with id_token claims. -
claimSanitizationStrategy
@Nonnull 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
The stashed UserInfo claims. This is allowably empty if the UserInfo endpoint was not used. -
idTokenClaims
The stashed id_token claims. This should never be null or empty onceAbstractAuthenticationAction.doPreExecute(ProfileRequestContext)has run.
-
-
Constructor Details
-
ProcessEndUserClaims
public ProcessEndUserClaims()Constructor.
-
-
Method Details
-
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, claims sanitization uses theDefaultClaimSanitizationStrategy.- Parameters:
enable- enable or disable claims sanitization
-
setEndUserClaimsContextLookupStrategy
public void setEndUserClaimsContextLookupStrategy(@Nonnull Function<ProfileRequestContext, EndUserClaimsContext> strategy) Set the strategy used to lookup aEndUserClaimsContext.- Parameters:
strategy- the strategy
-
setAccessTokenResponseContextLookupStrategy
public void setAccessTokenResponseContextLookupStrategy(@Nonnull Function<ProfileRequestContext, AccessTokenResponseContext> strategy) Set the strategy used to look up aAccessTokenResponseContext.- Parameters:
strategy- lookup strategy
-
setUserInfoResponseContextLookupStrategy
public void setUserInfoResponseContextLookupStrategy(@Nonnull Function<ProfileRequestContext, UserInfoResponseContext> strategy) Set the strategy used to look up aUserInfoResponseContext.- Parameters:
strategy- lookup strategy
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doPreExecutein classAbstractAuthenticationAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doExecutein classAbstractAuthenticationAction
-