Package net.shibboleth.idp.authn.impl
Class ValidateCredentials
- 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.AbstractValidationAction
-
- net.shibboleth.idp.authn.impl.ValidateCredentials
-
- All Implemented Interfaces:
net.shibboleth.idp.authn.CredentialValidator.ErrorHandler,net.shibboleth.idp.authn.CredentialValidator.WarningHandler,net.shibboleth.idp.authn.principal.PrincipalSupportingComponent,net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.profile.action.ProfileAction,Aware,MessageSource,MessageSourceAware,Action
public class ValidateCredentials extends net.shibboleth.idp.authn.AbstractValidationAction implements net.shibboleth.idp.authn.CredentialValidator.WarningHandler, net.shibboleth.idp.authn.CredentialValidator.ErrorHandlerAn action that processes a list ofCredentialValidatorobjects to produce anAuthenticationResult.- Since:
- 4.0.0
- Event:
EventIds.PROCEED_EVENT_ID, others on error- Precondition:
ProfileRequestContext.getSubcontext(AuthenticationContext.class).getAttemptedFlow() != null
-
-
Field Summary
Fields Modifier and Type Field Description private List<net.shibboleth.idp.authn.CredentialValidator>credentialValidatorsOrdered list of validators.private net.shibboleth.idp.authn.CredentialValidatorcurrentValidatorCurrently executing validator.private static StringDEFAULT_METRIC_NAMEDefault prefix for metrics.private booleanerrorSignaledTracks whether an error event was signaled.private net.shibboleth.idp.authn.AccountLockoutManagerlockoutManagerOptional lockout management interface.private org.slf4j.LoggerlogClass logger.private booleanrequireAllWhether all validators must succeed.private Collection<Subject>resultsResults from successful validators.private booleanwarningSignaledTracks whether a warning event was signaled.
-
Constructor Summary
Constructors Constructor Description ValidateCredentials()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)protected booleandoPreExecute(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)StringgetMetricName()voidhandleError(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, Exception e, String eventId)voidhandleError(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, String message, String eventId)voidhandleWarning(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, String message, String eventId)protected SubjectpopulateSubject(Subject subject)protected voidrecordSuccess(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)Record a successful authentication attempt against the configured counter, optionally clearing account lockout state.voidsetLockoutManager(net.shibboleth.idp.authn.AccountLockoutManager manager)Set an account lockout management component.voidsetRequireAll(boolean flag)Set whether to execute and require success from all configured validators, or stop at the first successful result.voidsetValidators(List<net.shibboleth.idp.authn.CredentialValidator> validators)Set the list of validators to use.-
Methods inherited from class net.shibboleth.idp.authn.AbstractValidationAction
addDefaultPrincipals, buildAuthenticationResult, getClassifiedErrors, getRequesterLookupStrategy, getResponderLookupStrategy, getResultCachingPredicate, getSubject, getSupportedPrincipals, recordFailure, recordSuccess, setAddDefaultPrincipals, setClassifiedMessages, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipals
-
Methods inherited from class net.shibboleth.idp.authn.AbstractAuthenticationAction
doExecute, 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
-
-
-
-
Field Detail
-
DEFAULT_METRIC_NAME
@Nonnull @NotEmpty private static final String DEFAULT_METRIC_NAME
Default prefix for metrics.- See Also:
- Constant Field Values
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
credentialValidators
@Nonnull @NonnullElements private List<net.shibboleth.idp.authn.CredentialValidator> credentialValidators
Ordered list of validators.
-
requireAll
private boolean requireAll
Whether all validators must succeed.
-
lockoutManager
@Nullable private net.shibboleth.idp.authn.AccountLockoutManager lockoutManager
Optional lockout management interface.
-
results
@Nonnull @NonnullElements private Collection<Subject> results
Results from successful validators.
-
currentValidator
@Nullable private net.shibboleth.idp.authn.CredentialValidator currentValidator
Currently executing validator.
-
warningSignaled
private boolean warningSignaled
Tracks whether a warning event was signaled.
-
errorSignaled
private boolean errorSignaled
Tracks whether an error event was signaled.
-
-
Method Detail
-
setLockoutManager
public void setLockoutManager(@Nullable net.shibboleth.idp.authn.AccountLockoutManager manager)Set an account lockout management component.- Parameters:
manager- lockout manager
-
setValidators
public void setValidators(@Nonnull @NonnullElements List<net.shibboleth.idp.authn.CredentialValidator> validators)Set the list of validators to use.- Parameters:
validators- validators to use
-
setRequireAll
public void setRequireAll(boolean flag)
Set whether to execute and require success from all configured validators, or stop at the first successful result.- Parameters:
flag- flag to set
-
getMetricName
@Nonnull @NotEmpty public String getMetricName()
- Overrides:
getMetricNamein classnet.shibboleth.idp.authn.AbstractValidationAction
-
handleWarning
public void handleWarning(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, @Nullable String message, @Nonnull @NotEmpty String eventId)- Specified by:
handleWarningin interfacenet.shibboleth.idp.authn.CredentialValidator.WarningHandler- Overrides:
handleWarningin classnet.shibboleth.idp.authn.AbstractValidationAction
-
handleError
public void handleError(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, @Nullable String message, @Nonnull @NotEmpty String eventId)- Specified by:
handleErrorin interfacenet.shibboleth.idp.authn.CredentialValidator.ErrorHandler- Overrides:
handleErrorin classnet.shibboleth.idp.authn.AbstractValidationAction
-
handleError
public void handleError(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, @Nonnull Exception e, @Nonnull @NotEmpty String eventId)- Specified by:
handleErrorin interfacenet.shibboleth.idp.authn.CredentialValidator.ErrorHandler- Overrides:
handleErrorin classnet.shibboleth.idp.authn.AbstractValidationAction
-
doPreExecute
protected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)- Overrides:
doPreExecutein classnet.shibboleth.idp.authn.AbstractValidationAction
-
doExecute
protected void doExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext, @Nonnull net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext)- Overrides:
doExecutein classnet.shibboleth.idp.authn.AbstractAuthenticationAction
-
populateSubject
@Nonnull protected Subject populateSubject(@Nonnull Subject subject)
- Specified by:
populateSubjectin classnet.shibboleth.idp.authn.AbstractValidationAction
-
recordSuccess
protected void recordSuccess(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext)Record a successful authentication attempt against the configured counter, optionally clearing account lockout state.- Parameters:
profileRequestContext- current profile request context
-
-