Class ExtractSAMLAttributes
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.profile.AbstractAgentRequestAction
net.shibboleth.sp.profile.AbstractAgentAction
net.shibboleth.sp.profile.AbstractApplicationAction
net.shibboleth.sp.saml.saml2.profile.impl.ExtractSAMLAttributes
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
An action that extracts
IdPAttribute objects from an inbound SAML 2.0 SSO response.
Attributes decoded from the assertion(s) are in an unfiltered state and subject to the filtering service. Any other data extracted is stored directly in the filtered set.
There are three supplemental sets: the optional "standard" set extracted from the message,
an optional profile config-supplied strategy function, and an optional use of the AttributeResolver
associated with the Application.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilt-in function to perform "standard" extraction of data into attributes. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether to accept decoded attributes that no filter rules applied to.private AttributeContextContext for externally supplied inbound attributes.Strategy used to createAttributeContextto hold results.private static final StringDefault prefix for metrics.private Function<ProfileRequestContext,String> Function used to obtain the issuer ID.private final org.slf4j.LoggerClass logger.private BrowserSSOProfileConfigurationStore off profile config.Strategy used to look up aRelyingPartyContextfor configuration options.private Function<ProfileRequestContext,String> Function used to obtain the requester ID.private SAMLTokenContextContext containing the token(s) to process.Strategy used to look upSAMLTokenContextto operate on.private Function<SAMLTokenContext,Collection<IdPAttribute>> Strategy for pulling out "standard" data from the response. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddecodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, Attribute input, Multimap<String, IdPAttribute> results) Access the registry of transcoding rules to decode the inputAttribute.private voiddecodeNameID(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, NameID input, Multimap<String, IdPAttribute> results) Access the registry of transcoding rules to decode the inputNameID.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext) private voidfilterAttributes(ProfileRequestContext profileRequestContext) Check for inbound attributes and apply filtering.private ResponsegetResponse(ProfileRequestContext profileRequestContext) Get the inboundResponsemessage.private voidpopulateFilterContext(ProfileRequestContext profileRequestContext, AttributeFilterContext filterContext) Fill in the filter context data.private voidprocessAttributes(ProfileRequestContext profileRequestContext) Process the inbound SAML Attributes and NameID.private Collection<IdPAttribute>resolveAttributes(ProfileRequestContext profileRequestContext) Perform internal attribute resolution using theApplication-associatedAttributeResolverservice.voidsetAcceptUnfilteredAttributes(boolean flag) Set whether to accept decodedIdPAttributeobjects pulled from the assertions if no filtering rule applied to them.voidSet the strategy used to create theAttributeContextto hold results.voidSet the strategy used to locate the attribute issuer ID for filtering.voidSet the strategy used to return theRelyingPartyContextfor configuration options.voidSet the strategy used to locate the attribute requester ID for filtering.voidSet the strategy used to return theSAMLTokenContextfor input.voidSet the strategy function to call for "standard" attribute extraction, if enabled.Methods inherited from class net.shibboleth.sp.profile.AbstractApplicationAction
ensureApplication, getApplicationMethods inherited from class net.shibboleth.sp.profile.AbstractAgentAction
ensureAgent, getAgentMethods inherited from class net.shibboleth.sp.profile.AbstractAgentRequestAction
ensureAgentRequestContext, getAgentRequestContext, setAgentRequestContextLookupStrategyMethods 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
-
DEFAULT_METRIC_NAME
Default prefix for metrics.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyStrategy used to look up aRelyingPartyContextfor configuration options. -
samlTokenContextLookupStrategy
Strategy used to look upSAMLTokenContextto operate on. -
requesterLookupStrategy
Function used to obtain the requester ID. -
issuerLookupStrategy
Function used to obtain the issuer ID. -
attributeContextCreationStrategy
Strategy used to createAttributeContextto hold results. -
standardExtractionStrategy
Strategy for pulling out "standard" data from the response. -
acceptUnfilteredAttributes
private boolean acceptUnfilteredAttributesWhether to accept decoded attributes that no filter rules applied to. -
samlTokenContext
Context containing the token(s) to process. -
profileConfiguration
Store off profile config. -
attributeContext
Context for externally supplied inbound attributes.
-
-
Constructor Details
-
ExtractSAMLAttributes
public ExtractSAMLAttributes()Constructor.
-
-
Method Details
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext, RelyingPartyContext> strategy) Set the strategy used to return theRelyingPartyContextfor configuration options.- Parameters:
strategy- lookup strategy
-
setSAMLTokenContextLookupStrategy
public void setSAMLTokenContextLookupStrategy(@Nonnull Function<ProfileRequestContext, SAMLTokenContext> strategy) Set the strategy used to return theSAMLTokenContextfor input.- Parameters:
strategy- lookup strategy
-
setRequesterLookupStrategy
Set the strategy used to locate the attribute requester ID for filtering.- Parameters:
strategy- lookup strategy
-
setIssuerLookupStrategy
Set the strategy used to locate the attribute issuer ID for filtering.- Parameters:
strategy- lookup strategy
-
setAttributeContextCreationStrategy
public void setAttributeContextCreationStrategy(@Nonnull Function<ProfileRequestContext, AttributeContext> strategy) Set the strategy used to create theAttributeContextto hold results.- Parameters:
strategy- creation strategy
-
setStandardExtractionStrategy
public void setStandardExtractionStrategy(@Nullable Function<SAMLTokenContext, Collection<IdPAttribute>> strategy) Set the strategy function to call for "standard" attribute extraction, if enabled.- Parameters:
strategy- strategy function
-
setAcceptUnfilteredAttributes
public void setAcceptUnfilteredAttributes(boolean flag) Set whether to accept decodedIdPAttributeobjects pulled from the assertions if no filtering rule applied to them.This is a variant of the original SP's "wildcard" rule support to allow non-enumerated attributes to be accepted.
- Parameters:
flag-
-
doPreExecute
- Overrides:
doPreExecutein classAbstractApplicationAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
getResponse
Get the inboundResponsemessage.- Parameters:
profileRequestContext- profile request context- Returns:
- inbound message
-
processAttributes
Process the inbound SAML Attributes and NameID.- Parameters:
profileRequestContext- current profile request context
-
decodeAttribute
private void decodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull Attribute input, @Nonnull @Live Multimap<String, IdPAttribute> results) throws AttributeDecodingExceptionAccess the registry of transcoding rules to decode the inputAttribute.- Parameters:
registry- registry of transcoding rulesprofileRequestContext- current profile request contextinput- input objectresults- collection to add results to- Throws:
AttributeDecodingException- if an error occurs or no results were obtained
-
decodeNameID
private void decodeNameID(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull NameID input, @Nonnull @Live Multimap<String, IdPAttribute> results) throws AttributeDecodingExceptionAccess the registry of transcoding rules to decode the inputNameID.- Parameters:
registry- registry of transcoding rulesprofileRequestContext- current profile request contextinput- input objectresults- collection to add results to- Throws:
AttributeDecodingException- if an error occurs or no results were obtained
-
filterAttributes
Check for inbound attributes and apply filtering.- Parameters:
profileRequestContext- current profile request context
-
populateFilterContext
private void populateFilterContext(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AttributeFilterContext filterContext) Fill in the filter context data.- Parameters:
profileRequestContext- current profile request contextfilterContext- context to populate
-
resolveAttributes
@Nullable private Collection<IdPAttribute> resolveAttributes(@Nonnull ProfileRequestContext profileRequestContext) Perform internal attribute resolution using theApplication-associatedAttributeResolverservice.- Parameters:
profileRequestContext- profile request context- Returns:
- resolved attributes
-