-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: d: user logged in, but user details could not be found. #67
Comments
Are the dev and production envs use the same LDAP/AD server? |
I am running in the exact same server, environment, and pointing at the same LDAP/AD server, with identical environment variables except for NODE_ENV=production. The only difference is that one is pre-compiled and the other is running in a just-in-time development environment. I also tried a clean Next.js app and encountered the same issue. I have been trying to debug the problem. I can see that the authentication part of the request is passing, so I think the issue is in Its pointing at an OpenLDAP server. |
As mentioned above, I managed to identify and verify the location of the problem: the search function is not returning any results and never triggering the searchEntry event that is used to update the user value. After some troubleshooting, it appears that the production build process might be the culprit. During minification, class, functions and some event names seem to be altered, which would likely be causing issues with the To address this, I excluded
Even though this example is specific to Next.js, this issue could happen with other frameworks that compile and minify code. Since |
That is interesting. I found this discuss on stack overflow: https://stackoverflow.com/questions/78448023/res-onsearchentry-from-ldap-js-does-not-returns-result-in-next-js-production |
Possibly a Next.js specific issue.
I'm using
Next.js
withldap-authentication
. There is no issue when running Next.js in development mode, but as soon as we do a production build, we encounter an issue retrieving user details after authentication.The authentication process works, but fetching the details fails. There is no code change between the development and production build.
We receive the following error.
Error:
d: user logged in, but user details could not be found. Probabaly usernameAttribute or userSearchBase is wrong?
Example Code:
We are using the latest version, but I have reverted back to 3.0.3 and am still encountering the same issue.
ldap-authentication@npm:3.2.2
├─ Version: 3.2.2
└─ Dependencies
└─ ldapjs@npm:^3.0.7 → npm:3.0.7
The text was updated successfully, but these errors were encountered: