mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-09 23:12:06 -03:30
LDAP Import: KERBEROS_PRINCIPAL not updated when UserPrincipal changes and KERBEROS_PRINCIPAL was null on creation
Closes #41520 (cherry picked from commit 79fc97056e22ebfd6a8f87a83f9e01a000441ac1) Signed-off-by: Martin Kanis <mkanis@redhat.com>
This commit is contained in:
parent
4699ea0662
commit
4e699e10da
@ -39,7 +39,7 @@ public class KerberosPrincipalAttributeMapper extends AbstractLDAPStorageMapper
|
||||
if (kerberosPrincipalAttribute != null) {
|
||||
String localKerberosPrincipal = user.getFirstAttribute(KERBEROS_PRINCIPAL);
|
||||
String ldapKerberosPrincipal = ldapUser.getAttributeAsString(kerberosPrincipalAttribute);
|
||||
if (ldapKerberosPrincipal != null && localKerberosPrincipal != null) {
|
||||
if (ldapKerberosPrincipal != null) {
|
||||
// update the Kerberos principal stored in DB as user's attribute if it doesn't match LDAP
|
||||
if (!ldapKerberosPrincipal.equals(localKerberosPrincipal)) {
|
||||
user.setSingleAttribute(KERBEROS_PRINCIPAL, ldapKerberosPrincipal);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user