Class DefaultUsernamePasswordAuthenticator
java.lang.Object
ch.tocco.nice2.userbase.impl.auth.DefaultUsernamePasswordAuthenticator
- All Implemented Interfaces:
UsernamePasswordAuthenticator
@Component
public class DefaultUsernamePasswordAuthenticator
extends Object
implements UsernamePasswordAuthenticator
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultUsernamePasswordAuthenticator(org.slf4j.Logger log, PrincipalService principalService, PasswordEncoder passwordEncoder, RecaptchaVerificationService recaptchaVerificationService) -
Method Summary
Modifier and TypeMethodDescriptionintpriority()Higher priority will be executed first.protected voidsetChallengeToNewPassword(Challenge challenge) voidsetMaxAttempts(int maxAttempts) booleanvalidateCredentialsForPrincipal(UsernamePasswordCredentials credentials, PrincipalDetails principalDetails, Challenge challenge)
-
Constructor Details
-
DefaultUsernamePasswordAuthenticator
public DefaultUsernamePasswordAuthenticator(org.slf4j.Logger log, PrincipalService principalService, PasswordEncoder passwordEncoder, RecaptchaVerificationService recaptchaVerificationService)
-
-
Method Details
-
setMaxAttempts
@Value("${nice2.userbase.twoStepLogin.attemptsTillBlock}") public void setMaxAttempts(int maxAttempts) -
priority
public int priority()Description copied from interface:UsernamePasswordAuthenticatorHigher priority will be executed first.- Specified by:
priorityin interfaceUsernamePasswordAuthenticator
-
validateCredentialsForPrincipal
public boolean validateCredentialsForPrincipal(UsernamePasswordCredentials credentials, PrincipalDetails principalDetails, Challenge challenge) - Specified by:
validateCredentialsForPrincipalin interfaceUsernamePasswordAuthenticator- Returns:
- true if the username/password combination is valid → the following authenticators won't be executed anymore
-
setChallengeToNewPassword
-