Class ValidateDuoAuthAPI
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.ValidateDuoAuthAPI
- All Implemented Interfaces:
PrincipalSupportingComponent,Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
An action that checks for a
DuoAuthenticationContext and directly produces an
AuthenticationResult based on that identity by authenticating against the Duo
AuthAPI.- Event:
EventIds.PROCEED_EVENT_ID,AuthnEventIds.AUTHN_EXCEPTION,AuthnEventIds.ACCOUNT_LOCKED,AuthnEventIds.ACCOUNT_WARNING,AuthnEventIds.ACCOUNT_ERROR,AuthnEventIds.NO_CREDENTIALS,AuthnEventIds.INVALID_CREDENTIALS- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null- Postcondition:
- If AuthenticationContext.getSubcontext(DuoAuthenticationContext.class) != null, then an
AuthenticationResultis saved to theAuthenticationContexton a successful login. On a failed login, theAbstractValidationAction.handleError(ProfileRequestContext, AuthenticationContext, String, String)method is called.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DuoAuthAuthenticatorImplementation of Duo AuthApi /auth endpoint.private static final StringDefault prefix for metrics.private DuoAuthenticationContextDuoApi context for tokens.private DuoIntegrationDuo integration to use.private Function<ProfileRequestContext,DuoIntegration> Lookp strategy for Duo integration.private final org.slf4j.LoggerClass logger.private DuoPreauthAuthenticatorImplementation of Duo AuthApi /preauth enpoint.private StringAttempted username.private Function<ProfileRequestContext,String> Lookup strategy for username to match against Duo identity. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildAuthenticationResult(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) getAuditFields(ProfileRequestContext profileRequestContext) protected SubjectpopulateSubject(Subject subject) voidsetAuthAuthenticator(DuoAuthAuthenticator authenticator) Set theDuoAuthAuthenticator.voidSet DuoIntegration details to use directly.voidSet DuoIntegration lookup strategy to use.voidsetPreauthAuthenticator(DuoPreauthAuthenticator authenticator) Set theDuoPreauthAuthenticator.voidSet the lookup strategy to use for the username to match against Duo identity.Methods inherited from class net.shibboleth.idp.authn.impl.AbstractAuditingValidationAction
doAudit, doExecute, getAuditContext, 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, 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
Class logger. -
duoIntegrationLookupStrategy
Lookp strategy for Duo integration. -
usernameLookupStrategy
Lookup strategy for username to match against Duo identity. -
authAuthenticator
Implementation of Duo AuthApi /auth endpoint. -
preauthAuthenticator
Implementation of Duo AuthApi /preauth enpoint. -
duoContext
DuoApi context for tokens. Non-Null after preExecute -
duoIntegration
Duo integration to use. -
username
Attempted username.
-
-
Constructor Details
-
ValidateDuoAuthAPI
public ValidateDuoAuthAPI()Constructor.
-
-
Method Details
-
setDuoIntegrationLookupStrategy
public void setDuoIntegrationLookupStrategy(@Nonnull Function<ProfileRequestContext, DuoIntegration> strategy) Set DuoIntegration lookup strategy to use.- Parameters:
strategy- lookup strategy
-
setDuoIntegration
Set DuoIntegration details to use directly.- Parameters:
duo- Duo integration details
-
setUsernameLookupStrategy
Set the lookup strategy to use for the username to match against Duo identity.- Parameters:
strategy- lookup strategy
-
setAuthAuthenticator
Set theDuoAuthAuthenticator.- Parameters:
authenticator- a Duo AuthAPI /auth endpoint implementation
-
setPreauthAuthenticator
Set theDuoPreauthAuthenticator.- Parameters:
authenticator- a Duo AuthAPI /preauth endpoint implementation
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
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
-
buildAuthenticationResult
protected void buildAuthenticationResult(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
buildAuthenticationResultin classAbstractValidationAction
-
getAuditFields
@Nullable @Unmodifiable @NotLive protected Map<String,String> getAuditFields(@Nonnull ProfileRequestContext profileRequestContext) - Overrides:
getAuditFieldsin classAbstractAuditingValidationAction
-