Accessing API with access token removes all group memberships which have been propagated via "Enable user group propagation" / JWT Group Sync #1530

Closed
opened 2025-11-20 05:32:18 -05:00 by saavagebueno · 0 comments
Owner

Originally created by @the-project-group on GitHub (Dec 30, 2024).

Describe the problem
When accessing the API with an access token of a user who propagated it's auto-groups to peers (JWT group sync), it removes all these groups from all the peers.
CleanShot 2024-12-30 at 18 38 20

To Reproduce

  1. access API with a token of a user who has group memberships from IDP JWT group sync propagated to peers:
curl -X GET https://netbird.domain.com:33073/api/peers \
    -H 'Accept: application/json' \
    -H 'Authorization: Token nbp_MY_TOKEN'
  1. The connected peers count drops immediately on all peers of the token user
  2. Click somewhere in the dashboard and the user's group information are propagated again

Workaround

  1. Create an dedicated API user which never adds peers
  2. Disable "User group propagation"

Analysis
So what happens is, when accessing the API, it access the API in the name of the user but is missing the group membership information of JWT and removes all groups from peers assigned via "Enable user group propagation".

NetBird Selfhosted version
0.35.1

What I wanted to say
Keep up the great work - The new networks feature is awesome!
Best regards, Flo.

Originally created by @the-project-group on GitHub (Dec 30, 2024). **Describe the problem** When accessing the API with an access token of a user who propagated it's auto-groups to peers (JWT group sync), it removes all these groups from all the peers. ![CleanShot 2024-12-30 at 18 38 20](https://github.com/user-attachments/assets/e25779ec-34f8-40b5-bfa7-9e6250df34a4) **To Reproduce** 1. access API with a token of a user who has group memberships from IDP JWT group sync propagated to peers: ``` curl -X GET https://netbird.domain.com:33073/api/peers \ -H 'Accept: application/json' \ -H 'Authorization: Token nbp_MY_TOKEN' ``` 2. The connected peers count drops immediately on all peers of the token user 3. Click somewhere in the dashboard and the user's group information are propagated again **Workaround** 1. Create an dedicated API user which never adds peers 2. Disable "User group propagation" **Analysis** So what happens is, when accessing the API, it access the API in the name of the user but is missing the group membership information of JWT and removes all groups from peers assigned via "Enable user group propagation". **NetBird Selfhosted version** `0.35.1` **What I wanted to say** Keep up the great work - The new networks feature is awesome! Best regards, Flo.
saavagebueno added the bugmanagement-service labels 2025-11-20 05:32:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1530