KEYCLOAK-16464 Allow to map emailVerified user model attribute to LDAP attribute
This commit is contained in:
parent
bcf313f321
commit
f76e9cc833
1 changed files with 15 additions and 0 deletions
|
@ -252,6 +252,12 @@ public class UserAttributeLDAPStorageMapper extends AbstractLDAPStorageMapper {
|
|||
super.setFirstName(firstName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEmailVerified(boolean verified) {
|
||||
setLDAPAttribute(UserModel.EMAIL_VERIFIED, Boolean.toString(verified));
|
||||
super.setEmailVerified(verified);
|
||||
}
|
||||
|
||||
protected boolean setLDAPAttribute(String modelAttrName, Object value) {
|
||||
if (modelAttrName.equalsIgnoreCase(userModelAttrName)) {
|
||||
if (UserAttributeLDAPStorageMapper.logger.isTraceEnabled()) {
|
||||
|
@ -382,6 +388,15 @@ public class UserAttributeLDAPStorageMapper extends AbstractLDAPStorageMapper {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmailVerified() {
|
||||
if (UserModel.EMAIL_VERIFIED.equalsIgnoreCase(userModelAttrName)) {
|
||||
return Boolean.parseBoolean(ldapUser.getAttributeAsString(ldapAttrName));
|
||||
} else {
|
||||
return super.isEmailVerified();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastName() {
|
||||
if (UserModel.LAST_NAME.equalsIgnoreCase(userModelAttrName)) {
|
||||
|
|
Loading…
Reference in a new issue