Class AddAttributesToClaimsSet
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.plugin.oidc.op.profile.impl.AbstractOIDCResponseAction
net.shibboleth.idp.plugin.oidc.op.profile.impl.AddAttributesToClaimsSet
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,org.springframework.beans.factory.Aware,org.springframework.context.MessageSource,org.springframework.context.MessageSourceAware,org.springframework.webflow.execution.Action
Action that adds claims to a
ClaimsSet. Claims are formed of resolved attributes having OIDC encoder. Action
verifies user has consented to release attribute, if consent information is available. Actions will not add claims
listed as reserved.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether we can add claims to IDToken by default i.e.Attributes to include in ID token no matter what.private Function<ProfileRequestContext,Set<String>> Strategy used to obtain the set of attribute IDs to include in the ID token in all cases.Strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.private AttributeContextAttributeContext to use.private ClaimsSetClaims Set to use.Strategy used to locate theOIDCAuthenticationResponseConsentContext.Attributes to omit from UserInfo token.private Function<ProfileRequestContext,Set<String>> Strategy used to obtain the set of attribute IDs to omit from the UserInfo token.private booleanWhether attributes that result in anAttributeEncodingExceptionwhen being encoded should be ignored or result in anIdPEventIds.UNABLE_ENCODE_ATTRIBUTEtransition.private org.slf4j.LoggerClass logger.List of claim names that will not be added.private Function<ProfileRequestContext,ClaimsSet> Strategy used to locate the responseClaimsSetassociated with a givenProfileRequestContext.Transcoder registry service object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) private voidencodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, IdPAttribute attribute, Collection<JSONObject> results) Access the registry of transcoding rules to transform the input attribute into claims.voidSet the strategy used to obtain the set of attribute IDs always included in ID tokens.voidSet the strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.voidSet the strategy used to obtain the set of attribute IDs to omit from UserInfo tokens.voidsetIgnoringUnencodableAttributes(boolean flag) Set whether the attributes that result in anAttributeEncodingExceptionwhen being encoded should be ignored or result in anIdPEventIds.UNABLE_ENCODE_ATTRIBUTEtransition.voidsetOIDCAuthenticationResponseConsentContextLookupStrategy(Function<ProfileRequestContext, OIDCAuthenticationResponseConsentContext> strategy) Set the strategy used to locate theOIDCAuthenticationResponseTokenClaimsContextassociated with a givenProfileRequestContext.voidsetReservedClaimNames(List<String> claimNames) Set list of claim names that will not be added.voidSet the strategy used to locate the responseClaimsSetassociated with a givenProfileRequestContext.voidSets the registry of transcoding rules to apply to encode attributes.Methods inherited from class net.shibboleth.idp.plugin.oidc.op.profile.impl.AbstractOIDCResponseAction
getMetadataContext, getOidcResponseContextMethods 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 org.slf4j.Logger logClass logger. -
attributeContextLookupStrategy
Strategy used to locate theAttributeContextassociated with a givenProfileRequestContext. -
responseClaimsSetLookupStrategy
Strategy used to locate the responseClaimsSetassociated with a givenProfileRequestContext. -
consentContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,OIDCAuthenticationResponseConsentContext> consentContextLookupStrategyStrategy used to locate theOIDCAuthenticationResponseConsentContext. -
alwaysIncludedAttributesLookupStrategy
Strategy used to obtain the set of attribute IDs to include in the ID token in all cases. -
deniedUserInfoAttributesLookupStrategy
Strategy used to obtain the set of attribute IDs to omit from the UserInfo token. -
transcoderRegistry
Transcoder registry service object. -
ignoringUnencodableAttributes
private boolean ignoringUnencodableAttributesWhether attributes that result in anAttributeEncodingExceptionwhen being encoded should be ignored or result in anIdPEventIds.UNABLE_ENCODE_ATTRIBUTEtransition. -
attributeCtx
AttributeContext to use. -
claimsSet
Claims Set to use. -
addToIDTokenByDefault
private boolean addToIDTokenByDefaultWhether we can add claims to IDToken by default i.e. response type is "id_token". -
reservedClaimNames
List of claim names that will not be added. -
alwaysIncludedAttributes
Attributes to include in ID token no matter what. -
deniedUserInfoAttributes
Attributes to omit from UserInfo token.
-
-
Constructor Details
-
AddAttributesToClaimsSet
AddAttributesToClaimsSet()Constructor.
-
-
Method Details
-
setIgnoringUnencodableAttributes
public void setIgnoringUnencodableAttributes(boolean flag) Set whether the attributes that result in anAttributeEncodingExceptionwhen being encoded should be ignored or result in anIdPEventIds.UNABLE_ENCODE_ATTRIBUTEtransition.- Parameters:
flag- flag to set
-
setReservedClaimNames
Set list of claim names that will not be added.- Parameters:
claimNames- list of claim names that will not be added.
-
setResponseClaimsSetLookupStrategy
public void setResponseClaimsSetLookupStrategy(@Nonnull Function<ProfileRequestContext, ClaimsSet> strategy) Set the strategy used to locate the responseClaimsSetassociated with a givenProfileRequestContext.- Parameters:
strategy- strategy used to locate the responseClaimsSetassociated with a givenProfileRequestContext
-
setAttributeContextLookupStrategy
public void setAttributeContextLookupStrategy(@Nonnull Function<ProfileRequestContext, AttributeContext> strategy) Set the strategy used to locate theAttributeContextassociated with a givenProfileRequestContext.- Parameters:
strategy- strategy used to locate theAttributeContextassociated with a givenProfileRequestContext
-
setOIDCAuthenticationResponseConsentContextLookupStrategy
public void setOIDCAuthenticationResponseConsentContextLookupStrategy(@Nonnull Function<ProfileRequestContext, OIDCAuthenticationResponseConsentContext> strategy) Set the strategy used to locate theOIDCAuthenticationResponseTokenClaimsContextassociated with a givenProfileRequestContext.- Parameters:
strategy- lookup strategy
-
setAlwaysIncludedAttributesLookupStrategy
public void setAlwaysIncludedAttributesLookupStrategy(@Nonnull Function<ProfileRequestContext, Set<String>> strategy) Set the strategy used to obtain the set of attribute IDs always included in ID tokens.- Parameters:
strategy- lookup strategy
-
setDeniedUserInfoAttributesLookupStrategy
public void setDeniedUserInfoAttributesLookupStrategy(@Nonnull Function<ProfileRequestContext, Set<String>> strategy) Set the strategy used to obtain the set of attribute IDs to omit from UserInfo tokens.- Parameters:
strategy- lookup strategy
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractOIDCResponseAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
encodeAttribute
private void encodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull @NonnullElements @Live Collection<JSONObject> results) throws AttributeEncodingException Access the registry of transcoding rules to transform the input attribute into claims.- Parameters:
registry- registry of transcoding rulesprofileRequestContext- current profile request contextattribute- input attributeresults- collection to add results to- Throws:
AttributeEncodingException- if a non-ignorable error occurs