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
ConstructorDescriptionDefaultUsernamePasswordAuthenticator
(org.slf4j.Logger log, PrincipalService principalService, PasswordEncoder passwordEncoder, RecaptchaVerificationService recaptchaVerificationService) -
Method Summary
Modifier and TypeMethodDescriptionint
priority()
Higher priority will be executed first.void
setMaxAttempts
(int maxAttempts) boolean
validateCredentialsForPrincipal
(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:UsernamePasswordAuthenticator
Higher priority will be executed first.- Specified by:
priority
in interfaceUsernamePasswordAuthenticator
-
validateCredentialsForPrincipal
public boolean validateCredentialsForPrincipal(UsernamePasswordCredentials credentials, PrincipalDetails principalDetails, Challenge challenge) - Specified by:
validateCredentialsForPrincipal
in interfaceUsernamePasswordAuthenticator
- Returns:
- true if the username/password combination is valid → the following authenticators won't be executed anymore
-