KEYCLOAK-16464 Allow to map enabled user model attribute to LDAP attribute
This commit is contained in:
parent
f76e9cc833
commit
2faf809536
1 changed files with 15 additions and 0 deletions
|
@ -240,6 +240,12 @@ public class UserAttributeLDAPStorageMapper extends AbstractLDAPStorageMapper {
|
|||
super.setEmail(lowercaseEmail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
setLDAPAttribute(UserModel.ENABLED, Boolean.toString(enabled));
|
||||
super.setEnabled(enabled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLastName(String lastName) {
|
||||
setLDAPAttribute(UserModel.LAST_NAME, lastName);
|
||||
|
@ -388,6 +394,15 @@ public class UserAttributeLDAPStorageMapper extends AbstractLDAPStorageMapper {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
if (UserModel.ENABLED.equalsIgnoreCase(userModelAttrName)) {
|
||||
return Boolean.parseBoolean(ldapUser.getAttributeAsString(ldapAttrName));
|
||||
} else {
|
||||
return super.isEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmailVerified() {
|
||||
if (UserModel.EMAIL_VERIFIED.equalsIgnoreCase(userModelAttrName)) {
|
||||
|
|
Loading…
Reference in a new issue