Class IsSecondFactor
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.webauthn.context.logic.IsSecondFactor
- All Implemented Interfaces:
Predicate<ProfileRequestContext>,Component,DestructableComponent,InitializableComponent
public class IsSecondFactor
extends AbstractInitializableComponent
implements Predicate<ProfileRequestContext>
A predicate that determines if the authentication flow is being used as a second factor of authentication, and not
a first (and possibly only) factor. Returns true if second factor use, or false if passwordless or first factor.
-
Field Summary
FieldsModifier and TypeFieldDescriptionWhich previous factors are acceptable to allow a second factor only WebAuthn flow.private Predicate<ProfileRequestContext>Determines if 2FA support should be enabled (true) or disabled (false).private final org.slf4j.LoggerClass logger.private Predicate<ProfileRequestContext>If true, set isSecondFactor to true irrespective of the conventional logic.private Function<ProfileRequestContext,String> Lookup strategy to find if a username has already been collected. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetAllowedPreviousFactors(Collection<String> factors) Set the allowable previous factors.voidsetEnabled(boolean flag) Set a flag that determines if 2FA support should be enabled (true) or disabled (false).voidsetEnabled(Predicate<ProfileRequestContext> predicate) Set a predicate that determines if 2FA support should be enabled (true) or disabled (false).voidsetSecondFactorOverride(boolean flag) Set an override flag that determines if a second factory authentication flow should be assumed.voidSet an override predicate that determines if a second factory authentication flow should be assumed.voidSet the lookup strategy to check if a username has already been collected.booleantest(ProfileRequestContext input) Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
secondFactorOverride
If true, set isSecondFactor to true irrespective of the conventional logic. -
enabled
Determines if 2FA support should be enabled (true) or disabled (false). If enabled, the request is checked for 2FA suitability as normal. -
usernameLookupStrategy
Lookup strategy to find if a username has already been collected. -
allowedPreviousFactors
Which previous factors are acceptable to allow a second factor only WebAuthn flow.
-
-
Constructor Details
-
IsSecondFactor
public IsSecondFactor()Constructor.
-
-
Method Details
-
setUsernameLookupStrategy
Set the lookup strategy to check if a username has already been collected.- Parameters:
strategy- lookup strategy
-
setEnabled
Set a predicate that determines if 2FA support should be enabled (true) or disabled (false). If enabled, the predicate is allowed to check 2FA suitability.- Parameters:
predicate- the predicate
-
setEnabled
public void setEnabled(boolean flag) Set a flag that determines if 2FA support should be enabled (true) or disabled (false). If enabled, the predicate is allowed to check 2FA suitability.- Parameters:
flag- the flag to set
-
setSecondFactorOverride
Set an override predicate that determines if a second factory authentication flow should be assumed. Ignoring the conventional logic of this predicate.- Parameters:
override- the override predicate
-
setSecondFactorOverride
public void setSecondFactorOverride(boolean flag) Set an override flag that determines if a second factory authentication flow should be assumed. Ignoring the conventional logic of this predicate.- Parameters:
flag- the flag to set
-
setAllowedPreviousFactors
Set the allowable previous factors.- Parameters:
factors- the factors to allow
-
test
- Specified by:
testin interfacePredicate<ProfileRequestContext>
-