LDAP authentication not working with server error "format requires a mapping" #22343
Replies: 4 comments
-
|
I think
|
Beta Was this translation helpful? Give feedback.
-
|
@zmaster7 thanks for the tip! Unfortunately, using the CN of the group instead did not change anything about the problem. However, this morning I noticed that after commenting out AUTH_LDAP_MIRROR_GROUPS and activating AUTH_LDAP_FIND_GROUP_PERMS, I could actually successfully log into NetBox. I actually don't understand why, because I swear it did not work yesterday, and I did not change anything else. Maybe there are some inconsistencies in my environment. Anyway, I'll keep an eye on it and mark this as answered for now, since it does seem to be working at the moment. |
Beta Was this translation helpful? Give feedback.
-
|
Unfortunately, I have to reopen this discussion, as my original problem reappeared. While LDAP login is working for my account now for some reason, when I try any other accounts, I get the same error as before. I even waited a few days and tried again to see if the problem would magically solve itself, like it did with my account, but that was not the case. Does anyone know what the cause of this behavior could be? |
Beta Was this translation helpful? Give feedback.
-
|
I noticed that the login works and the error does not occur when I deactivate both |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey everyone,
I'm currently having some trouble setting up LDAP authentication for NetBox 4.6.1. I'm not sure if something is wrong with my config and was wondering if someone could maybe point me in the right direction.
I'm currently using the following config for testing:
In
configuration.py:ldap_config.py(some parts of the DNs replaced with placeholders):The problem is that whenever I try to log in using my LDAP user, I just get a server error with the message "<class 'TypeError'> format requires a mapping". This is what appears in the NetBox log:
I'm not really sure how to interpret that error. I did find a similar error described in #1242, but since in my case the problem occurs regardless of whether my user is in the superuser group, I'm not sure if the two problems are related.
One weird thing I noticed: If I comment out AUTH_LDAP_MIRROR_GROUPS and instead activate AUTH_LDAP_FIND_GROUP_PERMS, restart NetBox, then reverse the config change, restart NetBox again, and then reload the NetBox web page (with the server error), I am suddenly successfully logged in. However, my LDAP group is not replicated in NetBox, which, as I understood the documentation, was supposed to happen when I put it in AUTH_LDAP_MIRROR_GROUPS. Anyway, as soon as I log out, I cannot log in again; it only works this once. Not sure if this is relevant, but it seems like in general authentication is working; otherwise, I shouldn't be able to log in once. So my guess was it has something to do with group mappings, but I don't know what else to try. Does anyone have any ideas?
Thanks in advance for any advice you can give!
David
Beta Was this translation helpful? Give feedback.
All reactions