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 boolean
Whether "auto" should be the default for factor and device.private boolean
Whether to trust, and extract, the client address.private String
Header name for device.private String
Header name for factor.private final org.slf4j.Logger
Class logger.private String
Header name for passcode.private Function<ProfileRequestContext,
Map<String, String>> Strategy function for populating pushinfo AuthAPI parameter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doExecute
(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) Performs this authentication action.protected void
extractHeaders
(DuoAuthenticationContext context) Extracts the Duo API arguments passed in via the request headers.boolean
Get whether "auto" is the default setting.boolean
Get whether the client address should be trusted for use in API calls.void
setAutoAuthenticationSupported
(boolean flag) Set whether "auto" is the default setting.void
setClientAdddressTrusted
(boolean flag) Set whether the client address should be trusted for use in API calls.void
setDeviceHeader
(String headerName) Set the device header name.void
setFactorHeader
(String headerName) Set the factor header name.void
setPasscodeHeader
(String headerName) Set the passcode header name.void
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 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:
doExecute
in 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
-