Class DuoOIDCAuthnController
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.duo.impl.DuoOIDCAuthnController
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent
@ThreadSafe
@Controller
@RequestMapping("%{idp.duo.oidc.externalAuthnPath:/Authn/Duo/2FA}")
public class DuoOIDCAuthnController
extends AbstractInitializableComponent
MVC controller for managing Duo 2FA exchanges implemented as an ExternalAuthentication
mechanism.
The controller initiates the Duo OIDC authorization code grant flow and accepts the authorization code response.
Is effectively immutable once published by Spring. Is a thread-safe singleton.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the Http parameter that stores the authorisation code.Lookup strategy to locate the Duo authentication context.private final org.slf4j.LoggerClass logger.static final StringThe name of the Http parameter that stores the state value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidauthorizationCallback(HttpServletRequest httpRequest, HttpServletResponse httpResponse) The redirect_uri endpoint for accepting an authorization code and resuming the flow execution.voidauthorizationRequest(HttpServletRequest httpRequest, HttpServletResponse httpResponse) Start the Duo ODIC authorization code flow.Internally synchronized method for accessing the Duo context lookup strategy.voidSet Duo authentication context lookup strategy to use.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
CODE_PARAMETER
The name of the Http parameter that stores the authorisation code.- See Also:
-
STATE_PARAMETER
The name of the Http parameter that stores the state value.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
duoContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,DuoOIDCAuthenticationContext> duoContextLookupStrategyLookup strategy to locate the Duo authentication context.
-
-
Constructor Details
-
DuoOIDCAuthnController
public DuoOIDCAuthnController()Constructor.
-
-
Method Details
-
setDuoContextLookupStrategy
public void setDuoContextLookupStrategy(@Nonnull Function<ProfileRequestContext, DuoOIDCAuthenticationContext> strategy) Set Duo authentication context lookup strategy to use.- Parameters:
strategy- lookup strategy
-
getDuoContextLookupStrategy
Internally synchronized method for accessing the Duo context lookup strategy.- Returns:
- the duo context lookup strategy.
-
authorizationRequest
@GetMapping("/authorize") public void authorizationRequest(@Nonnull HttpServletRequest httpRequest, @Nonnull HttpServletResponse httpResponse) throws ExternalAuthenticationException, IOException Start the Duo ODIC authorization code flow. The SWF execution key is encoded in the state parameter so it can be extracted on return from Duo.- Parameters:
httpRequest- servlet requesthttpResponse- servlet response- Throws:
ExternalAuthenticationException- if an error occursIOException- if an I/O error occurs
-
authorizationCallback
@GetMapping("/duo-callback") public void authorizationCallback(@Nonnull HttpServletRequest httpRequest, @Nonnull HttpServletResponse httpResponse) throws ExternalAuthenticationException, IOException The redirect_uri endpoint for accepting an authorization code and resuming the flow execution.- Parameters:
httpRequest- servlet requesthttpResponse- servlet response- Throws:
ExternalAuthenticationException- if an error occursIOException- if an I/O error occurs
-