LDAP groups are not considered, when using API token #2077

Closed
opened 2025-12-29 17:22:04 +01:00 by adam · 3 comments
Owner

Originally created by @christianpinger on GitHub (Oct 30, 2018).

Netbox version: 2.4.6
Python version: 3.5.2

  • I have a netbox user, authenticated via LDAP.
  • The user has a ldap group cn=platform,ou=groups,dc=company,dc=com
  • I've created a group platform in Netbox Admin, which allows the user to create, modify, delete IP adresses and the same for api tokens
  • If the user uses the netbox gui, he can create, modify and delete IP adresses
  • If the user uses a self created the api token, he get an error: curl -X POST "https://netbox.company.com/api/ipam/ip-addresses/" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token XXXXXXXXXXXX" -d "{ \"address\": \"10.12.16.1/24\"}" {"detail":"You do not have permission to perform this action."}
  • Here comes the interesting detail: If I manualy assign the group platform the the user, the api request is successful.

So my assumption is, if a user uses an API token, LDAP groups of this user are not mapped to netbox groups.

Originally created by @christianpinger on GitHub (Oct 30, 2018). Netbox version: 2.4.6 Python version: 3.5.2 * I have a netbox user, authenticated via LDAP. * The user has a ldap group `cn=platform,ou=groups,dc=company,dc=com` * I've created a group `platform` in Netbox Admin, which allows the user to create, modify, delete IP adresses and the same for api tokens * If the user uses the netbox gui, he can create, modify and delete IP adresses * If the user uses a self created the api token, he get an error: `curl -X POST "https://netbox.company.com/api/ipam/ip-addresses/" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Token XXXXXXXXXXXX" -d "{ \"address\": \"10.12.16.1/24\"}" {"detail":"You do not have permission to perform this action."}` * Here comes the interesting detail: If I manualy assign the group `platform` the the user, the api request is successful. So my assumption is, if a user uses an API token, LDAP groups of this user are not mapped to netbox groups.
adam added the status: acceptedtype: documentation labels 2025-12-29 17:22:04 +01:00
adam closed this issue 2025-12-29 17:22:04 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 4, 2018):

Does the suggestion posted in #1547 fix this?

AUTH_LDAP_MIRROR_GROUPS = True
@jeremystretch commented on GitHub (Dec 4, 2018): Does the suggestion posted in #1547 fix this? ``` AUTH_LDAP_MIRROR_GROUPS = True ```
Author
Owner

@christianpinger commented on GitHub (Dec 5, 2018):

Yes, thank you. That is the solution

@christianpinger commented on GitHub (Dec 5, 2018): Yes, thank you. That is the solution
Author
Owner

@jeremystretch commented on GitHub (Dec 5, 2018):

Reopening this as a documentation issue.

@jeremystretch commented on GitHub (Dec 5, 2018): Reopening this as a documentation issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#2077