Class ValidateDuoTokenAuthenticationResult
- java.lang.Object
-
- net.shibboleth.utilities.java.support.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
public class ValidateDuoTokenAuthenticationResult extends AbstractAuditingValidationAction
A validation action that checks for a valid Duo authentication token and directly produces anAuthenticationResultbased 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 Classes Modifier and Type Class Description static classValidateDuoTokenAuthenticationResult.DuoOIDCCleanupHookA default cleanup hook that removes theDuoOIDCAuthenticationContextfrom the tree.
-
Field Summary
Fields Modifier and Type Field Description private com.nimbusds.jwt.JWTClaimsSetclaimsSetThe parsed claimset.private Function<ProfileRequestContext,Collection<Principal>>contextToPrincipalMappingStrategyHook to map context information (often Duo factors in the Duo token) to principal collections.private DuoOIDCAuthenticationContextduoContextDuo authentiction context.private org.slf4j.LoggerlogClass logger.private ProfileRequestContextprcThe profile request context.private StringusernameAttempted username.
-
Constructor Summary
Constructors Constructor Description ValidateDuoTokenAuthenticationResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidbuildAuthenticationResult(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)protected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)private StringextractFactor()Extract the second-factor use for authentication.Function<ProfileRequestContext,Collection<Principal>>getContextToPrincipalMappingStrategy()Get the context to principal mapping strategy for mapping context information into principal collections e.g.protected SubjectpopulateSubject(Subject subject)voidsetContextToPrincipalMappingStrategy(Function<ProfileRequestContext,Collection<Principal>> hook)Set 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, setWriteAuditLogAction
-
Methods inherited from class net.shibboleth.idp.authn.AbstractValidationAction
addDefaultPrincipals, getClassifiedErrors, getCleanupHook, getMetricName, getRequesterLookupStrategy, getResponderLookupStrategy, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, recordFailure, recordSuccess, setAddDefaultPrincipals, setClassifiedMessages, setCleanupHook, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipals
-
Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, setAuthenticationContextLookupStrategy
-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy
-
Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationCondition
-
Methods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplier
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
duoContext
@Nullable private DuoOIDCAuthenticationContext duoContext
Duo authentiction context.
-
prc
@Nullable private ProfileRequestContext prc
The profile request context.
-
claimsSet
@Nullable private com.nimbusds.jwt.JWTClaimsSet claimsSet
The parsed claimset.
-
contextToPrincipalMappingStrategy
@Nullable private Function<ProfileRequestContext,Collection<Principal>> contextToPrincipalMappingStrategy
Hook to map context information (often Duo factors in the Duo token) to principal collections.
-
-
Method Detail
-
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
@Nonnull private String extractFactor()
Extract the second-factor use for authentication. Taken from the auth_context. Will return 'unspecified' if not found.- Returns:
- the second-factor used, or 'unspecified' if not found. Should always be found.
-
populateSubject
protected Subject populateSubject(@Nonnull Subject subject)
- Specified by:
populateSubjectin classAbstractValidationAction
-
buildAuthenticationResult
protected void buildAuthenticationResult(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)- Overrides:
buildAuthenticationResultin classAbstractValidationAction
-
-