Interface LDAPCredentialEncoder
- All Known Subinterfaces:
LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder,LDAPCredentialEncoder.LDAPCredentialToStringEncoder
- All Known Implementing Classes:
ActiveDirectoryCredentialEncoder,EncryptingCredentialEncoder,EnforceUnencryptedCredentialEncoder
public interface LDAPCredentialEncoder
Encodes and/or encrypts a given
PasswordCredential to the value expected by a particular directory connector.
This interface should not be implemented directly; implement LDAPCredentialEncoder.LDAPCredentialToStringEncoder or
LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder instead.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
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
-
Method Details
-
encodeCredential
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. Return type MUST be either String or byte[].- 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:
- An encoded password, suitable for passing to the directory.
- Throws:
InvalidCredentialException- If the password could not be encoded.
-
supportsSettingEncryptedPasswords
boolean supportsSettingEncryptedPasswords()- Returns:
trueif the LDAP directory supports client-side encryption of passwords.
-