public class EnforceUnencryptedCredentialEncoder extends Object implements LDAPCredentialEncoder.LDAPCredentialToStringEncoder
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.LDAPCredentialEncoder.LDAPCredentialToByteArrayEncoder, LDAPCredentialEncoder.LDAPCredentialToStringEncoder
Constructor and Description |
---|
EnforceUnencryptedCredentialEncoder(PasswordHelper passwordHelper) |
Modifier and Type | Method and Description |
---|---|
String |
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.
|
PasswordHelper |
getPasswordHelper() |
boolean |
supportsSettingEncryptedPasswords() |
public EnforceUnencryptedCredentialEncoder(PasswordHelper passwordHelper)
public String encodeCredential(PasswordCredential passwordCredential) throws InvalidCredentialException
LDAPCredentialEncoder
encodeCredential
in interface LDAPCredentialEncoder
encodeCredential
in interface LDAPCredentialEncoder.LDAPCredentialToStringEncoder
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 if
PasswordCredential.isEncryptedCredential()
returns true
(although it may still encode the credential to the format
required by the directory). The value of
PasswordCredential.getCredential()
is also
guaranteed to be non-null.InvalidCredentialException
- if PasswordCredential.isEncryptedCredential()
returns true AND the given passwordCredential is not equal to PasswordCredential.NONE
LDAPCredentialEncoder.encodeCredential(com.atlassian.crowd.embedded.api.PasswordCredential)
public boolean supportsSettingEncryptedPasswords()
supportsSettingEncryptedPasswords
in interface LDAPCredentialEncoder
true
if the LDAP directory supports client-side encryption of passwords.public PasswordHelper getPasswordHelper()
Copyright © 2020 Atlassian. All rights reserved.