Class DefaultPasswordTokenValidator<P extends PasswordToken>
java.lang.Object
com.broadleafcommerce.auth.user.validation.DefaultPasswordTokenValidator<P>
- All Implemented Interfaces:
PasswordTokenValidator<P>
public class DefaultPasswordTokenValidator<P extends PasswordToken>
extends Object
implements PasswordTokenValidator<P>
- Author:
- Nathan Moore (nathanmoore).
-
Constructor Summary
ConstructorDescriptionDefaultPasswordTokenValidator
(Duration tokenTtl, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder) -
Method Summary
Modifier and TypeMethodDescriptionboolean
exists
(String token, Collection<P> passwordTokens) boolean
isExpired
(String token, Collection<P> passwordTokens) protected boolean
isTokenExpired
(PasswordToken passwordToken) boolean
isUsed
(String token, Collection<P> passwordTokens) boolean
isValid
(String token, Collection<P> passwordTokens) Performs all checks
-
Constructor Details
-
DefaultPasswordTokenValidator
public DefaultPasswordTokenValidator(Duration tokenTtl, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
-
-
Method Details
-
exists
- Specified by:
exists
in interfacePasswordTokenValidator<P extends PasswordToken>
-
isUsed
- Specified by:
isUsed
in interfacePasswordTokenValidator<P extends PasswordToken>
-
isExpired
- Specified by:
isExpired
in interfacePasswordTokenValidator<P extends PasswordToken>
-
isValid
Description copied from interface:PasswordTokenValidator
Performs all checks- Specified by:
isValid
in interfacePasswordTokenValidator<P extends PasswordToken>
- Parameters:
token
- the token to validatepasswordTokens
- A set of tokens belonging to a user- Returns:
- if the given token is valid for the given user
-
isTokenExpired
-
getTokenTtl
-