Class PostValidatePasswordlessEvaluation
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
The EventIds.PROCEED_EVENT_ID event is a signal that no further steps are
required and the flow should complete as is.
The PROMPT_USER_EVENT event is a signal that the user should be asked to
opt into passwordless use in the future, resulting in the creation of a guard cookie.
This action will also remove the cookie if a non-cacheable login happens and is set to react to that, and will remove the cookie if the existing cookie's value doesn't match the username in the transaction.
This is also where the cleanup hook is relocated, in order to defer that step and preserve access to the Duo state.
- Since:
- 2.1.0
- Event:
PROMPT_USER_EVENT,EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class) != null,AuthenticationContext.getSubcontext(DuoOIDCAuthenticationContext.class) != null,DuoOIDCAuthenticationContext.getDuoIntegration() != null
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Consumer<ProfileRequestContext>A cleanup hook to execute after processing.private PasswordlessCookieManagerCookie manager to use.private booleanWhether to detect mismatches between cookie and current username.private final org.slf4j.LoggerClass logger.private Predicate<ProfileRequestContext>Condition governing "new" eligibility.static final StringCustom event to signal that a prompt to opt into passwordless should be presented.private booleanWhether to require the authentication be cacheable to allow this. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) protected voidprotected voiddoPostExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) private StringgetUsername(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext) Gets the username associated with this Duo run.voidSet the cleanup hook to execute after processing.voidSetsPasswordlessCookieManagerto use.voidsetDetectUsernameMismatch(boolean flag) Sets whether to detect a mismatch between the passwordless cookie and the current username.voidsetPasswordlessCondition(Predicate<ProfileRequestContext> condition) Set condition governing eligibility for passwordless opt-in.voidsetRequireResultCacheable(boolean flag) Sets whether a non-cacheable result should force the condition to return false.Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, 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, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
PROMPT_USER_EVENT
Custom event to signal that a prompt to opt into passwordless should be presented.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
cleanupHook
A cleanup hook to execute after processing. -
passwordlessCondition
Condition governing "new" eligibility. -
cookieManager
Cookie manager to use. -
requireResultCacheable
private boolean requireResultCacheableWhether to require the authentication be cacheable to allow this. -
detectUsernameMismatch
private boolean detectUsernameMismatchWhether to detect mismatches between cookie and current username.
-
-
Constructor Details
-
PostValidatePasswordlessEvaluation
public PostValidatePasswordlessEvaluation()Constructor.
-
-
Method Details
-
setCleanupHook
Set the cleanup hook to execute after processing.- Parameters:
hook- cleanup hook
-
setPasswordlessCondition
Set condition governing eligibility for passwordless opt-in.- Parameters:
condition-
-
setCookieManager
SetsPasswordlessCookieManagerto use.- Parameters:
manager- cookie manager
-
setRequireResultCacheable
public void setRequireResultCacheable(boolean flag) Sets whether a non-cacheable result should force the condition to return false.This defaults to "true" which subsequently honors the "do not remember" option on the login views.
- Parameters:
flag- flag to set
-
setDetectUsernameMismatch
public void setDetectUsernameMismatch(boolean flag) Sets whether to detect a mismatch between the passwordless cookie and the current username.Defaults to true. When detected, a mismatch clears the existing cookoie and proceeds as though it were absent.
- Parameters:
flag- flag to set
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doPreExecutein classAbstractAuthenticationAction
-
doExecute
protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) - Overrides:
doExecutein classAbstractAuthenticationAction
-
doPostExecute
- Overrides:
doPostExecutein classAbstractProfileAction
-
getUsername
@Nullable private String getUsername(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext) Gets the username associated with this Duo run.- Parameters:
profileRequestContext- profile request contextauthenticationContext- authentication context- Returns:
- username from current transaction or null
-