diff --git a/federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/UserAttributeLDAPStorageMapper.java b/federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/UserAttributeLDAPStorageMapper.java index dd30a41697..75386967a5 100644 --- a/federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/UserAttributeLDAPStorageMapper.java +++ b/federation/ldap/src/main/java/org/keycloak/storage/ldap/mappers/UserAttributeLDAPStorageMapper.java @@ -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)) {