Class AtlassianSecurityPasswordEncoder
java.lang.Object
com.atlassian.crowd.password.encoder.AtlassianSecurityPasswordEncoder
- All Implemented Interfaces:
InternalPasswordEncoder,PasswordEncoder,UpgradeablePasswordEncoder
public class AtlassianSecurityPasswordEncoder
extends Object
implements InternalPasswordEncoder, UpgradeablePasswordEncoder
This class is responsible for encoding and validating passwords using Atlassian Password Encoder from Atlassian
Security project, while also validating passwords encoded in Atlassian SHA1 format in order to be backwards
compatible.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodePassword(String rawPass, Object salt) Encodes the provided rawPass using an Atlassian Password Encoder from Atlassian Security project.getKey()The key to define this password encoderbooleanisPasswordValid(String encPass, String rawPass, Object salt) Returns true if the rawPass is the same password that was used to create encPass.booleanisUpgradeRequired(String encPass) Returns true if the password is encoded using an older scheme, and if it should be re-encoded and updated.
-
Constructor Details
-
AtlassianSecurityPasswordEncoder
public AtlassianSecurityPasswordEncoder()
-
-
Method Details
-
encodePassword
Encodes the provided rawPass using an Atlassian Password Encoder from Atlassian Security project.- Specified by:
encodePasswordin interfacePasswordEncoder- Parameters:
rawPass- the password to encodesalt- not used. Anullvalue is legal.- Returns:
- encoded password
- Throws:
PasswordEncoderException- if there were any issues trying to encode a password- See Also:
-
DefaultPasswordEncoder
-
isPasswordValid
Returns true if the rawPass is the same password that was used to create encPass.- Specified by:
isPasswordValidin interfacePasswordEncoder- Parameters:
encPass- a pre-encoded password in either Atlassian SHA1 form or the form provided byDefaultPasswordEncoder.getDefaultInstance()from atlassian-password-encoder.rawPass- a raw password to encode and compare against the pre-encoded passwordsalt- not used. Anullvalue is legal.- Returns:
- true if the rawPass is the same password that was used to create encPass
-
isUpgradeRequired
Returns true if the password is encoded using an older scheme, and if it should be re-encoded and updated.- Specified by:
isUpgradeRequiredin interfaceUpgradeablePasswordEncoder- Parameters:
encPass- a pre-encoded password- Returns:
- true if the password is encoded using an older scheme, and if it should be re-encoded and updated.
-
getKey
Description copied from interface:PasswordEncoderThe key to define this password encoder- Specified by:
getKeyin interfacePasswordEncoder
-