Class ValidateOIDCAuthentication
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.authn.AbstractValidationAction
net.shibboleth.idp.plugin.authn.oidc.rp.impl.ValidateOIDCAuthentication
- All Implemented Interfaces:
PrincipalSupportingComponent,Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
An action that builds an
AuthenticationResult based on an inbound OIDC authentication response.
A EndUserClaimsContext is used as the basis of the result, which stores the merged id_token and
UserInfo claims set, alongside the raw id_token claims.
Actual validation is all upstream of this action, but the use of the ValidationAction subclass is a convenience for auditing and handling the result.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX,IdPEventIds.INVALID_RELYING_PARTY_CTX,IdPEventIds.INVALID_PROFILE_CONFIG,AuthnEventIds.NO_CREDENTIALS- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null
- Postcondition:
- If AuthenticationContext.getSubcontext(EndUserClaimsContext.class, false)!= null,
then an
AuthenticationResultis saved to theAuthenticationContext.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Function<Collection<String>,Collection<Principal>> Incoming context translation function for converting OIDC ACRs into Principals.private Function<Collection<String>,Collection<Principal>> Incoming context translation function for converting OIDC ACRs into Principals.private AttributeContextContext for externally supplied inbound attributes.private Function<ProfileRequestContext,Collection<IdPAttribute>> Pluggable strategy function for generalized extraction of data.private ReloadableService<AttributeFilter>Service used to get the engine used to filter attributes.private Function<ProfileRequestContext,Collection<Principal>> A hook to map context information to private credentials.private static final StringDefault prefix for metrics.private final Function<ProfileRequestContext,EndUserClaimsContext> Strategy used to look up theEndUserClaimsContextto set the parameters for.private EndUserClaimsContextThe context with claims pertaining to the end-user of this authentication.private final org.slf4j.LoggerClass logger.private MetadataResolverOptional supplemental metadata source for filtering.private ProfileRequestContextThe profile request context.Store off profile config.Strategy used to look up aRelyingPartyContextfor configuration options.Transcoder registry service object.private com.nimbusds.jwt.JWTClaimsSetThe set of id_token claims before they are processed. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate ProxyAuthenticationPrincipalConstruct a populatedProxyAuthenticationPrincipalbased on the upstream OP (the issuer of the id_token).private voiddecodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, net.minidev.json.JSONObject input, Multimap<String, IdPAttribute> results) Access the registry of transcoding rules to transform (decode) the input claims to IdP Attributes.protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) private voidfilterAttributes(ProfileRequestContext profileRequestContext) Check for inbound attributes and apply filtering.private voidpopulateFilterContext(ProfileRequestContext profileRequestContext, AttributeFilterContext filterContext) Fill in the filter context data.protected SubjectpopulateSubject(Subject subject) private voidprocessAttributes(ProfileRequestContext profileRequestContext) Process the inbound OIDC claims.voidSets the strategy function to invoke for generalized extraction of data intoIdPAttributeobjects for inclusion in theAuthenticationResult.voidsetAttributeFilter(ReloadableService<AttributeFilter> filterService) Sets the filter service to use for inbound attributes.voidsetContextToPrivateCredentialsMappingStrategy(Function<ProfileRequestContext, Collection<Principal>> strategy) Set the context to principal mapping strategy for mapping context information into principal collections to place in the private credentials set of the subject.voidsetMetadataResolver(MetadataResolver resolver) Set a metadata source to use during filtering.voidSet the strategy used to return theRelyingPartyContextfor configuration options.voidSets the registry of transcoding rules to apply to encode attributes.Methods inherited from class net.shibboleth.idp.authn.AbstractValidationAction
addDefaultPrincipals, buildAuthenticationResult, getClassifiedErrors, getCleanupHook, getMetricName, getRequesterLookupStrategy, getResponderLookupStrategy, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, recordFailure, recordSuccess, setAddDefaultPrincipals, setClassifiedMessages, setCleanupHook, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipalsMethods 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
-
DEFAULT_METRIC_NAME
Default prefix for metrics.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
transcoderRegistry
Transcoder registry service object. -
attributeFilterService
Service used to get the engine used to filter attributes. -
metadataResolver
Optional supplemental metadata source for filtering. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyStrategy used to look up aRelyingPartyContextfor configuration options. -
contextToPrivateCredentialsMappingStrategy
@Nullable private Function<ProfileRequestContext,Collection<Principal>> contextToPrivateCredentialsMappingStrategyA hook to map context information to private credentials. -
profileConfiguration
Store off profile config. -
endUserContext
The context with claims pertaining to the end-user of this authentication. -
unprocessedIdTokenClaims
The set of id_token claims before they are processed. -
endUserClaimsContextLookupStrategy
@Nonnull private final Function<ProfileRequestContext,EndUserClaimsContext> endUserClaimsContextLookupStrategyStrategy used to look up theEndUserClaimsContextto set the parameters for. -
attributeContext
Context for externally supplied inbound attributes. -
acrTranslator
Incoming context translation function for converting OIDC ACRs into Principals. -
amrTranslator
Incoming context translation function for converting OIDC ACRs into Principals. -
attributeExtractionStrategy
@Nullable private Function<ProfileRequestContext,Collection<IdPAttribute>> attributeExtractionStrategyPluggable strategy function for generalized extraction of data. -
prc
The profile request context.
-
-
Constructor Details
-
ValidateOIDCAuthentication
public ValidateOIDCAuthentication()Constructor.
-
-
Method Details
-
setContextToPrivateCredentialsMappingStrategy
public void setContextToPrivateCredentialsMappingStrategy(@Nullable Function<ProfileRequestContext, Collection<Principal>> strategy) Set the context to principal mapping strategy for mapping context information into principal collections to place in the private credentials set of the subject.- Parameters:
strategy- the strategy to use
-
setMetadataResolver
Set a metadata source to use during filtering.- Parameters:
resolver- metadata resolver
-
setRelyingPartyContextLookupStrategy
public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext, RelyingPartyContext> strategy) Set the strategy used to return theRelyingPartyContextfor configuration options.- Parameters:
strategy- lookup strategy
-
setAttributeExtractionStrategy
public void setAttributeExtractionStrategy(@Nullable Function<ProfileRequestContext, Collection<IdPAttribute>> strategy) Sets the strategy function to invoke for generalized extraction of data intoIdPAttributeobjects for inclusion in theAuthenticationResult.- Parameters:
strategy- extraction strategy
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doPreExecutein classAbstractValidationAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doExecutein classAbstractAuthenticationAction
-
populateSubject
- Specified by:
populateSubjectin classAbstractValidationAction
-
buildProxyPrincipal
Construct a populatedProxyAuthenticationPrincipalbased on the upstream OP (the issuer of the id_token).- Returns:
- a constructed
ProxyAuthenticationPrincipalto include in theSubject
-
processAttributes
Process the inbound OIDC claims.- Parameters:
profileRequestContext- current profile request context
-
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
-
decodeAttribute
private void decodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull net.minidev.json.JSONObject input, @Nonnull @NonnullElements @Live Multimap<String, IdPAttribute> results) throws AttributeDecodingExceptionAccess the registry of transcoding rules to transform (decode) the input claims to IdP Attributes.- Parameters:
registry- registry of transcoding rulesprofileRequestContext- current profile request contextinput- input attributeresults- collection to add results to- Throws:
AttributeDecodingException- if a non-ignorable error occurs
-