public class ValidateDuoAuthAPI extends AbstractValidationAction
DuoAuthenticationContext and directly produces an
AuthenticationResult based on that identity by authenticating against the Duo
AuthAPI.EventIds.PROCEED_EVENT_ID, AuthnEventIds.AUTHN_EXCEPTION, AuthnEventIds.ACCOUNT_LOCKED, AuthnEventIds.ACCOUNT_WARNING, AuthnEventIds.ACCOUNT_ERROR, AuthnEventIds.NO_CREDENTIALS, AuthnEventIds.INVALID_CREDENTIALS
ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null
AuthenticationResult is saved to the AuthenticationContext on a
successful login. On a failed login, the
AbstractValidationAction.handleError(ProfileRequestContext, AuthenticationContext, String, String)
method is called.| Modifier and Type | Field and Description |
|---|---|
private DuoAuthAuthenticator |
authAuthenticator
Implementation of Duo AuthApi /auth endpoint.
|
private static String |
DEFAULT_METRIC_NAME
Default prefix for metrics.
|
private DuoAuthenticationContext |
duoContext
DuoApi context for tokens.
|
private DuoIntegration |
duoIntegration
Duo integration to use.
|
private com.google.common.base.Function<ProfileRequestContext,DuoIntegration> |
duoIntegrationLookupStrategy
Lookp strategy for Duo integration.
|
private org.slf4j.Logger |
log
Class logger.
|
private DuoPreauthAuthenticator |
preauthAuthenticator
Implementation of Duo AuthApi /preauth enpoint.
|
private String |
username
Attempted username.
|
private com.google.common.base.Function<ProfileRequestContext,String> |
usernameLookupStrategy
Lookup strategy for username to match against Duo identity.
|
| Constructor and Description |
|---|
ValidateDuoAuthAPI()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildAuthenticationResult(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected void |
doExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected void |
doInitialize() |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected Subject |
populateSubject(Subject subject) |
void |
setAuthAuthenticator(DuoAuthAuthenticator authenticator)
Set the
DuoAuthAuthenticator. |
void |
setDuoIntegration(DuoIntegration duo)
Set DuoIntegration details to use directly.
|
void |
setDuoIntegrationLookupStrategy(com.google.common.base.Function<ProfileRequestContext,DuoIntegration> strategy)
Set DuoIntegration lookup strategy to use.
|
void |
setPreauthAuthenticator(DuoPreauthAuthenticator authenticator)
Set the
DuoPreauthAuthenticator. |
void |
setUsernameLookupStrategy(com.google.common.base.Function<ProfileRequestContext,String> strategy)
Set the lookup strategy to use for the username to match against Duo identity.
|
addDefaultPrincipals, getClassifiedErrors, getMetricName, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, recordFailure, recordSuccess, setAddDefaultPrincipals, setClassifiedMessages, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipalsdoExecute, doPreExecute, setLookupStrategydoExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull @NotEmpty private static final String DEFAULT_METRIC_NAME
@Nonnull private com.google.common.base.Function<ProfileRequestContext,DuoIntegration> duoIntegrationLookupStrategy
@Nonnull private com.google.common.base.Function<ProfileRequestContext,String> usernameLookupStrategy
@Nonnull private DuoAuthAuthenticator authAuthenticator
@Nonnull private DuoPreauthAuthenticator preauthAuthenticator
@Nonnull @NotEmpty private DuoAuthenticationContext duoContext
@Nullable private DuoIntegration duoIntegration
public void setDuoIntegrationLookupStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,DuoIntegration> strategy)
strategy - lookup strategypublic void setDuoIntegration(@Nonnull DuoIntegration duo)
duo - Duo integration detailspublic void setUsernameLookupStrategy(@Nonnull com.google.common.base.Function<ProfileRequestContext,String> strategy)
strategy - lookup strategypublic void setAuthAuthenticator(@Nonnull DuoAuthAuthenticator authenticator)
DuoAuthAuthenticator.authenticator - a Duo AuthAPI /auth endpoint implementationpublic void setPreauthAuthenticator(@Nonnull DuoPreauthAuthenticator authenticator)
DuoPreauthAuthenticator.authenticator - a Duo AuthAPI /preauth endpoint implementationprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doPreExecute in class AbstractValidationActionprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationActionprotected Subject populateSubject(@Nonnull Subject subject)
populateSubject in class AbstractValidationActionprotected void buildAuthenticationResult(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
buildAuthenticationResult in class AbstractValidationActionCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.