Class TOTPCredentialValidator
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.idp.authn.AbstractCredentialValidator
net.shibboleth.idp.plugin.authn.totp.impl.TOTPCredentialValidator
- All Implemented Interfaces:
CredentialValidator,PrincipalSupportingComponent,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
A
CredentialValidator that checks for a TOTPContext.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.shibboleth.idp.authn.CredentialValidator
CredentialValidator.ErrorHandler, CredentialValidator.WarningHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TOTPAuthenticatorTOTP implementation.private static final StringDefault prefix for metrics.private final org.slf4j.LoggerClass logger.private PatternA regular expression to apply for acceptance testing.private Consumer<ProfileRequestContext>Source of token seeds.private Function<AuthenticationContext,TOTPContext> Lookup strategy for TOTP context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected SubjectdoValidate(ProfileRequestContext profileRequestContext, AuthenticationContext authenticationContext, CredentialValidator.WarningHandler warningHandler, CredentialValidator.ErrorHandler errorHandler) protected SubjectpopulateSubject(Subject subject, ProfileRequestContext profileRequestContext, TOTPContext totpContext) Decorate the subject with "standard" content from the validation.voidSet TOTP implementation to use.voidsetMatchExpression(Pattern expression) Set a matching expression to apply to the username for acceptance.voidsetSeedSource(Consumer<ProfileRequestContext> source) Set source of token seeds.voidSet the lookup strategy to locate theTOTPContext.Methods inherited from class net.shibboleth.idp.authn.AbstractCredentialValidator
getLogPrefix, getSupportedPrincipals, isAcceptable, populateSubject, setActivationCondition, setId, setSupportedPrincipals, validateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, 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.IdentifiedComponent
getId
-
Field Details
-
DEFAULT_METRIC_NAME
Default prefix for metrics.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
totpContextLookupStrategy
Lookup strategy for TOTP context. -
authenticator
TOTP implementation. -
seedSource
Source of token seeds. -
matchExpression
A regular expression to apply for acceptance testing.
-
-
Constructor Details
-
TOTPCredentialValidator
public TOTPCredentialValidator()Constructor.
-
-
Method Details
-
setTOTPContextLookupStrategy
public void setTOTPContextLookupStrategy(@Nonnull Function<AuthenticationContext, TOTPContext> strategy) Set the lookup strategy to locate theTOTPContext.- Parameters:
strategy- lookup strategy
-
setAuthenticator
Set TOTP implementation to use.- Parameters:
impl- TOTP implementation
-
setSeedSource
Set source of token seeds.- Parameters:
source- seed source
-
setMatchExpression
Set a matching expression to apply to the username for acceptance.- Parameters:
expression- a matching expression
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
doValidate
protected Subject doValidate(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nullable CredentialValidator.WarningHandler warningHandler, @Nullable CredentialValidator.ErrorHandler errorHandler) throws Exception - Specified by:
doValidatein classAbstractCredentialValidator- Throws:
Exception
-
populateSubject
@Nonnull protected Subject populateSubject(@Nonnull Subject subject, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull TOTPContext totpContext) Decorate the subject with "standard" content from the validation.- Parameters:
subject- the subject being returnedprofileRequestContext- current profile request contexttotpContext- the TOTP context being validated- Returns:
- the decorated subject
-