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
Constructors Constructor Description DefaultPasswordTokenValidator(Duration tokenTtl, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
exists(String token, Collection<P> passwordTokens)
Duration
getTokenTtl()
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 Detail
-
DefaultPasswordTokenValidator
public DefaultPasswordTokenValidator(Duration tokenTtl, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
-
-
Method Detail
-
exists
public boolean exists(String token, Collection<P> passwordTokens)
- Specified by:
exists
in interfacePasswordTokenValidator<P extends PasswordToken>
-
isUsed
public boolean isUsed(String token, Collection<P> passwordTokens)
- Specified by:
isUsed
in interfacePasswordTokenValidator<P extends PasswordToken>
-
isExpired
public boolean isExpired(String token, Collection<P> passwordTokens)
- Specified by:
isExpired
in interfacePasswordTokenValidator<P extends PasswordToken>
-
isValid
public boolean isValid(String token, Collection<P> passwordTokens)
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
protected boolean isTokenExpired(PasswordToken passwordToken)
-
getTokenTtl
public Duration getTokenTtl()
-
-