mirror of
https://github.com/keycloak/keycloak.git
synced 2025-12-16 20:15:46 -06:00
Check if kerberos auth is enabled before creating the kerberos principal in LDAPStorageProvider
- prevents misleading warn messages from being logged
Closes #25294
Signed-off-by: Stefan Guilhen <sguilhen@redhat.com>
(cherry picked from commit 143ccbfa15)
This commit is contained in:
committed by
Alexander Schwartz
parent
907aadfbf4
commit
c6bee418d7
@@ -569,7 +569,7 @@ public class LDAPStorageProvider implements UserStorageProvider,
|
||||
if(getLdapIdentityStore().getConfig().isTrustEmail()){
|
||||
imported.setEmailVerified(true);
|
||||
}
|
||||
if (kerberosConfig.getKerberosPrincipalAttribute() != null) {
|
||||
if (kerberosConfig.isAllowKerberosAuthentication() && kerberosConfig.getKerberosPrincipalAttribute() != null) {
|
||||
String kerberosPrincipal = ldapUser.getAttributeAsString(kerberosConfig.getKerberosPrincipalAttribute());
|
||||
if (kerberosPrincipal == null) {
|
||||
logger.warnf("Kerberos principal attribute not found on LDAP user [%s]. Configured kerberos principal attribute name is [%s]", ldapUser.getDn(), kerberosConfig.getKerberosPrincipalAttribute());
|
||||
|
||||
Reference in New Issue
Block a user