Class ActiveDirectoryCredentialEncoder
java.lang.Object
com.atlassian.crowd.directory.ldap.credential.ActiveDirectoryCredentialEncoder
- All Implemented Interfaces:
LDAPCredentialEncoder,LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder
public class ActiveDirectoryCredentialEncoder
extends Object
implements LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder
An encoder specifically for Microsoft Active Directory that first delegates to the provided base encoder and then
converts the result of that to the byte[] format that Active Directory expects.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.atlassian.crowd.directory.ldap.credential.LDAPCredentialEncoder
LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder, LDAPCredentialEncoder.LDAPCredentialToStringEncoder -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionbyte[]encodeCredential(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
-
ActiveDirectoryCredentialEncoder
public ActiveDirectoryCredentialEncoder(LDAPCredentialEncoder.LDAPCredentialToStringEncoder baseEncoder)
-
-
Method Details
-
encodeCredential
public byte[] 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.LDAPCredentialToByteArrayEncoder- 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:
- byte[] instead of Object
- Throws:
InvalidCredentialException- If the password could not be encoded.- See Also:
-
supportsSettingEncryptedPasswords
public boolean supportsSettingEncryptedPasswords()- Specified by:
supportsSettingEncryptedPasswordsin interfaceLDAPCredentialEncoder- Returns:
trueif the LDAP directory supports client-side encryption of passwords.
-
getBaseEncoder
-