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
public class ExtractDuoAuthenticationFromHeaders extends AbstractAuthenticationAction
An action that extracts the Duo factor and device or passcode from HTTP request headers into aDuoAuthenticationContext, and attaches it to theAuthenticationContext.- 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
Fields Modifier and Type Field Description private booleanautoAuthenticationSupportedWhether "auto" should be the default for factor and device.private booleanclientAddressTrustedWhether to trust, and extract, the client address.private StringdeviceHeaderNameHeader name for device.private StringfactorHeaderNameHeader name for factor.private org.slf4j.LoggerlogClass logger.private StringpasscodeHeaderNameHeader name for passcode.private Function<ProfileRequestContext,Map<String,String>>pushInfoLookupStrategyStrategy function for populating pushinfo AuthAPI parameter.
-
Constructor Summary
Constructors Constructor Description ExtractDuoAuthenticationFromHeaders()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext)protected voidextractHeaders(DuoAuthenticationContext context)Extracts the Duo API arguments passed in via the request headers.booleanisAutoAuthenticationSupported()Get whether "auto" is the default setting.booleanisClientAddressTrusted()Get 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.voidsetPushInfoLookupStrategy(Function<ProfileRequestContext,Map<String,String>> strategy)Set lookup strategy for AuthAPI pushinfo parameter.-
Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, doPreExecute, doPreExecute, setAuthenticationContextLookupStrategy
-
Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getMessage, getMessage, getMessage, 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, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
-
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.
-
autoAuthenticationSupported
private boolean autoAuthenticationSupported
Whether "auto" should be the default for factor and device.
-
clientAddressTrusted
private boolean clientAddressTrusted
Whether to trust, and extract, the client address.
-
pushInfoLookupStrategy
@Nullable private Function<ProfileRequestContext,Map<String,String>> pushInfoLookupStrategy
Strategy function for populating pushinfo AuthAPI parameter.
-
-
Method Detail
-
setFactorHeader
public void setFactorHeader(@Nonnull @NotEmpty String headerName)
Set the factor header name.- Parameters:
headerName- the factor header name
-
setDeviceHeader
public void setDeviceHeader(@Nonnull @NotEmpty String headerName)
Set the device header name.- Parameters:
headerName- the factor header name
-
setPasscodeHeader
public void setPasscodeHeader(@Nonnull @NotEmpty String headerName)
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)- Overrides:
doExecutein classAbstractAuthenticationAction
-
extractHeaders
protected void extractHeaders(@Nonnull DuoAuthenticationContext context)Extracts the Duo API arguments passed in via the request headers.- Parameters:
context- the DuoApiAuthContext to store the parameters in
-
-