Class ValidateDuoTokenAuthenticationResult
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.authn.impl.AbstractAuditingValidationAction
net.shibboleth.idp.plugin.authn.duo.impl.ValidateDuoTokenAuthenticationResult
- All Implemented Interfaces:
PrincipalSupportingComponent,Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
A validation action that checks for a valid Duo authentication token and directly produces an
AuthenticationResult based on the identity described by the token.- Event:
EventIds.PROCEED_EVENT_ID,AuthnEventIds.AUTHN_EXCEPTION,AuthnEventIds.INVALID_AUTHN_CTX- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class, false) != null,AuthenticationContext.getSubcontext(DuoOIDCAuthenticationContext.class, false) != null
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA default cleanup hook that removes theDuoOIDCAuthenticationContextfrom the tree. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.nimbusds.jwt.JWTClaimsSetThe parsed claimset.private Function<ProfileRequestContext,Collection<Principal>> Hook to map context information (often Duo factors in the Duo token) to principal collections.private static final StringDefault prefix for metrics.private DuoOIDCAuthenticationContextDuo authentiction context.private DuoOIDCIntegrationThe Duo integration.private final org.slf4j.LoggerClass logger.private ProfileRequestContextThe profile request context.private StringAttempted username. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildAuthenticationResult(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) private StringExtract the second-factor used for authentication as taken from the auth_context.Get the context to principal mapping strategy for mapping context information into principal collections e.g.protected SubjectpopulateSubject(Subject subject) voidSet the context to principal mapping strategy for mapping context information into principal collections e.g.Methods inherited from class net.shibboleth.idp.authn.impl.AbstractAuditingValidationAction
doAudit, doExecute, getAuditContext, getAuditFields, recordFailure, recordSuccess, setAuditContextCreationStrategy, setPopulateAuditContextAction, setWriteAuditLogActionMethods inherited from class net.shibboleth.idp.authn.AbstractValidationAction
addDefaultPrincipals, getClassifiedErrors, getCleanupHook, getMetricName, getRequesterLookupStrategy, getResponderLookupStrategy, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, 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
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. -
duoContext
Duo authentiction context. -
duoIntegration
The Duo integration. -
prc
The profile request context. -
claimsSet
The parsed claimset. -
username
Attempted username. -
contextToPrincipalMappingStrategy
@Nullable private Function<ProfileRequestContext,Collection<Principal>> contextToPrincipalMappingStrategyHook to map context information (often Duo factors in the Duo token) to principal collections.
-
-
Constructor Details
-
ValidateDuoTokenAuthenticationResult
public ValidateDuoTokenAuthenticationResult()Constructor.
-
-
Method Details
-
getContextToPrincipalMappingStrategy
@Nullable public Function<ProfileRequestContext,Collection<Principal>> getContextToPrincipalMappingStrategy()Get the context to principal mapping strategy for mapping context information into principal collections e.g. Duo factors.- Returns:
- the mapping hook
-
setContextToPrincipalMappingStrategy
public void setContextToPrincipalMappingStrategy(@Nullable Function<ProfileRequestContext, Collection<Principal>> hook) Set the context to principal mapping strategy for mapping context information into principal collections e.g. Duo factors.- Parameters:
hook- principal mapping hook
-
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
-
extractFactor
Extract the second-factor used for authentication as taken from the auth_context. Will returnnullif not found.- Returns:
- the second-factor used, or
nullif not found. Should always be found.
-
populateSubject
- Specified by:
populateSubjectin classAbstractValidationAction
-
buildAuthenticationResult
protected void buildAuthenticationResult(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
buildAuthenticationResultin classAbstractValidationAction
-