Class ExtractDuoAuthenticationFromHeaders
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.duo.impl.ExtractDuoAuthenticationFromHeaders
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
An action that extracts the Duo factor and device or passcode from HTTP request headers into a
DuoAuthenticationContext, and attaches it to the AuthenticationContext.- Event:
EventIds.PROCEED_EVENT_ID,AuthnEventIds.NO_CREDENTIALS- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null- Postcondition:
- If getHttpServletRequest() != null, the content of the headers are checked.
The information found will be attached via a
DuoAuthenticationContext.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether "auto" should be the default for factor and device.private booleanWhether to trust, and extract, the client address.private StringHeader name for device.private StringHeader name for factor.private final org.slf4j.LoggerClass logger.private StringHeader name for passcode.private Function<ProfileRequestContext,Map<String, String>> Strategy function for populating pushinfo AuthAPI parameter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) Performs this authentication action.protected voidextractHeaders(DuoAuthenticationContext context) Extracts the Duo API arguments passed in via the request headers.booleanGet whether "auto" is the default setting.booleanGet whether the client address should be trusted for use in API calls.voidsetAutoAuthenticationSupported(boolean flag) Set whether "auto" is the default setting.voidsetClientAdddressTrusted(boolean flag) Set whether the client address should be trusted for use in API calls.voidsetDeviceHeader(String headerName) Set the device header name.voidsetFactorHeader(String headerName) Set the factor header name.voidsetPasscodeHeader(String headerName) Set the passcode header name.voidSet lookup strategy for AuthAPI pushinfo parameter.Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, 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, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, setHttpServletRequest, setHttpServletRequestSupplier, setHttpServletResponse, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, 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.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
autoAuthenticationSupported
private boolean autoAuthenticationSupportedWhether "auto" should be the default for factor and device. -
clientAddressTrusted
private boolean clientAddressTrustedWhether to trust, and extract, the client address. -
factorHeaderName
Header name for factor. -
deviceHeaderName
Header name for device. -
passcodeHeaderName
Header name for passcode. -
pushInfoLookupStrategy
Strategy function for populating pushinfo AuthAPI parameter.
-
-
Constructor Details
-
ExtractDuoAuthenticationFromHeaders
ExtractDuoAuthenticationFromHeaders()Constructor.
-
-
Method Details
-
setFactorHeader
Set the factor header name.- Parameters:
headerName- the factor header name
-
setDeviceHeader
Set the device header name.- Parameters:
headerName- the factor header name
-
setPasscodeHeader
Set the passcode header name.- Parameters:
headerName- the factor header name
-
isClientAddressTrusted
public boolean isClientAddressTrusted()Get whether the client address should be trusted for use in API calls.- Returns:
- whether client address should be trusted
-
setClientAdddressTrusted
public void setClientAdddressTrusted(boolean flag) Set whether the client address should be trusted for use in API calls.- Parameters:
flag- flag to set
-
isAutoAuthenticationSupported
public boolean isAutoAuthenticationSupported()Get whether "auto" is the default setting.- Returns:
- whether "auto" is the default setting
-
setAutoAuthenticationSupported
public void setAutoAuthenticationSupported(boolean flag) Set whether "auto" is the default setting.- Parameters:
flag- flag to set
-
setPushInfoLookupStrategy
public void setPushInfoLookupStrategy(@Nullable Function<ProfileRequestContext, Map<String, String>> strategy) Set lookup strategy for AuthAPI pushinfo parameter.- Parameters:
strategy- lookup strategy
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) Performs this authentication action. Default implementation throws an exception.- Overrides:
doExecutein classAbstractAuthenticationAction- Parameters:
profileRequestContext- the current IdP profile request contextauthenticationContext- the current authentication context
-
extractHeaders
Extracts the Duo API arguments passed in via the request headers.- Parameters:
context- the DuoApiAuthContext to store the parameters in
-