Class EnforceUnencryptedCredentialEncoder
java.lang.Object
com.atlassian.crowd.directory.ldap.credential.EnforceUnencryptedCredentialEncoder
- All Implemented Interfaces:
LDAPCredentialEncoder,LDAPCredentialEncoder.LDAPCredentialToStringEncoder
public class EnforceUnencryptedCredentialEncoder
extends Object
implements LDAPCredentialEncoder.LDAPCredentialToStringEncoder
An encoder which passes a non-encrypted
PasswordCredential's credential through untouched, but throws an
exception for every already-encrypted (i.e. when PasswordCredential.isEncryptedCredential() returns true).
The exception is PasswordCredential.NONE, in which case it generates a random password and returns that instead.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.crowd.directory.ldap.credential.LDAPCredentialEncoder
LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder, LDAPCredentialEncoder.LDAPCredentialToStringEncoder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionencodeCredential(PasswordCredential passwordCredential) Given an plain-text password, encodes/encrypts it according to the settings required by the particular directory connector which this encoder is intended to be used with.boolean
-
Constructor Details
-
EnforceUnencryptedCredentialEncoder
-
-
Method Details
-
encodeCredential
public String encodeCredential(PasswordCredential passwordCredential) throws InvalidCredentialException Description copied from interface:LDAPCredentialEncoderGiven an plain-text password, encodes/encrypts it according to the settings required by the particular directory connector which this encoder is intended to be used with. Return type MUST be either String or byte[].- Specified by:
encodeCredentialin interfaceLDAPCredentialEncoder- Specified by:
encodeCredentialin interfaceLDAPCredentialEncoder.LDAPCredentialToStringEncoder- Parameters:
passwordCredential- The password credential to be encoded, guanteed to be non-null. If the subclass supports encrypting the given passwordCredential, it should NOT do so ifPasswordCredential.isEncryptedCredential()returnstrue(although it may still encode the credential to the format required by the directory). The value ofPasswordCredential.getCredential()is also guaranteed to be non-null.- Returns:
- String instead of Object
- Throws:
InvalidCredentialException- ifPasswordCredential.isEncryptedCredential()returns true AND the given passwordCredential is not equal toPasswordCredential.NONE- See Also:
-
supportsSettingEncryptedPasswords
public boolean supportsSettingEncryptedPasswords()- Specified by:
supportsSettingEncryptedPasswordsin interfaceLDAPCredentialEncoder- Returns:
trueif the LDAP directory supports client-side encryption of passwords.
-
getPasswordHelper
-