Error when writing user from Keycloak to LDAP #35002
Replies: 4 comments 1 reply
-
hey,
|
Beta Was this translation helpful? Give feedback.
-
Hello, All the mappers are configured the same as the development environment where I don't have the issue. Most of the mappers are defaulted, it's just the MSAD and username mappers that I have changed. MSAD has checkboxes unchecked and the username mapper uses email instead of cn. |
Beta Was this translation helpful? Give feedback.
-
Did you find a solution to this yet? I have the same problem here. |
Beta Was this translation helpful? Give feedback.
-
I believe we're running into a similar issue on 26.1.2. When we create a user in the UI, the user does get created, but we're met with an error and the user is not fully configured. We see the following in the logs:
Most search results suggest that
The MSADUserAccountControlStorageMapper is trying to write a userAccountControl value of 0, which is not a valid value. I suspect this is because setEnabled has been recently modified to write to AD immediately in #34470. My suspicion is that I'm going to try to find the time to debug this, but I'm commenting here in the hopes that someone who's already familiar with the codebase and setup to test can do so as well. Edit: I just found #29206 which refers to some consistency issues when using clustered OpenLDAP. We're using a multi-DC AD, as well, and according to Microsoft, AD-DS uses a multi-master loose consistency with convergence replication model. Now I'm wondering if, perhaps, createSubcontext should return the entire context/object, rather than just the UUID. Again, hoping someone who's actually familiar with the codebase can provide insight. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I have a Keycloak 26.0.5 server deployed that is linked to a google IdP and federated with an Active Directory environment.
If I create a user in Keycloak UI, the user gets written into LDAP.
If I login into a client using the IdP, it does not create the user in AD and fails with the following error:
KC-SERVICES0013: Failed authentication: java.lang.NullPointerException: Cannot invoke "org.keycloak.storage.ldap.idm.model.LDAPDn.toString()" because the return value of "org.keycloak.storage.ldap.idm.model.LDAPObject.getDn()" is null
at org.keycloak.storage.ldap.mappers.msad.MSADUserAccountControlStorageMapper$MSADUserModelDelegate.setEnabled(MSADUserAccountControlStorageMapper.java:252)
at org.keycloak.authentication.authenticators.broker.IdpCreateUserIfUniqueAuthenticator.authenticateImpl(IdpCreateUserIfUniqueAuthenticator.java:87)
at org.keycloak.authentication.authenticators.broker.AbstractIdpAuthenticator.authenticate(AbstractIdpAuthenticator.java:76)
at org.keycloak.authentication.DefaultAuthenticationFlow.processSingleFlowExecutionModel(DefaultAuthenticationFlow.java:465)
at org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:291)
at org.keycloak.authentication.DefaultAuthenticationFlow.processSingleFlowExecutionModel(DefaultAuthenticationFlow.java:400)
at org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:269)
at org.keycloak.authentication.AuthenticationProcessor.authenticateOnly(AuthenticationProcessor.java:1074)
at org.keycloak.services.resources.LoginActionsService$1.authenticateOnly(LoginActionsService.java:919)
at org.keycloak.authentication.AuthenticationProcessor.authenticate(AuthenticationProcessor.java:912)
at org.keycloak.services.resources.LoginActionsService.processFlow(LoginActionsService.java:380)
at org.keycloak.services.resources.LoginActionsService.brokerLoginFlow(LoginActionsService.java:951)
at org.keycloak.services.resources.LoginActionsService.firstBrokerLoginGet(LoginActionsService.java:823)
at org.keycloak.services.resources.LoginActionsService$quarkusrestinvoker$firstBrokerLoginGet_4319965f5ab7d0aadd2e5b5f2cde702e4aaaf535.invoke(Unknown Source)
at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:635)
at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2516)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2495)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1521)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:1583)
This is working in my development environment with Keycloak version 25.0.6.
Can anyone help me understand why it's failing?
Beta Was this translation helpful? Give feedback.
All reactions