[GH-ISSUE #2083] Auto assign user role (user|admin|owner) based on idp groups at login stage. #4205

Closed
opened 2026-08-05 00:56:26 -04:00 by saavagebueno · 6 comments
Owner

Originally created by @marcportabellaclotet-mt on GitHub (May 31, 2024).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/2083

Is your feature request related to a problem? Please describe.

When a user logs in via an identity provider (IdP), they are assigned the "user" role by default. Is it possible to use the JWT token information (such as groups) to perform role mapping?

Describe the solution you'd like
I would like that users which are part of an idp group, for example "netbird admins" are automatically assigned the "admin" role in Netbird

Describe alternatives you've considered
I can achieve this using api calls to netbird, but a native integration would be appreciated.

Originally created by @marcportabellaclotet-mt on GitHub (May 31, 2024). Original GitHub issue: https://github.com/netbirdio/netbird/issues/2083 **Is your feature request related to a problem? Please describe.** When a user logs in via an identity provider (IdP), they are assigned the "user" role by default. Is it possible to use the JWT token information (such as groups) to perform role mapping? **Describe the solution you'd like** I would like that users which are part of an idp group, for example "netbird admins" are automatically assigned the "admin" role in Netbird **Describe alternatives you've considered** I can achieve this using api calls to netbird, but a native integration would be appreciated.
saavagebueno added the feature-request label 2026-08-05 00:56:26 -04:00
Author
Owner

@pappz commented on GitHub (Jun 4, 2024):

Hello @marcportabellaclotet-mt
Thank you for your feature request!
Right now we don’t sync the user role. The only way to control user role is through the NetBird dashboard. We will consider what we can do.

<!-- gh-comment-id:2147125043 --> @pappz commented on GitHub (Jun 4, 2024): Hello @marcportabellaclotet-mt Thank you for your feature request! Right now we don’t sync the user role. The only way to control user role is through the NetBird dashboard. We will consider what we can do.
Author
Owner

@marcportabellaclotet-mt commented on GitHub (Dec 2, 2024):

Is there any plan to support this feature? Thanks!

<!-- gh-comment-id:2511273056 --> @marcportabellaclotet-mt commented on GitHub (Dec 2, 2024): Is there any plan to support this feature? Thanks!
Author
Owner

@MichalNemec commented on GitHub (Jun 9, 2025):

there is now this:

Image

but it seems like its not working? in our usecase client_roles has ["string", "string"] but no group was created.

EDIT: oops, user didnt have a client role, now it works.

<!-- gh-comment-id:2956533997 --> @MichalNemec commented on GitHub (Jun 9, 2025): there is now this: <img width="515" alt="Image" src="https://github.com/user-attachments/assets/8214df09-1292-47b9-95cc-68e0051ddc2f" /> but it seems like its not working? in our usecase client_roles has ["string", "string"] but no group was created. EDIT: oops, user didnt have a client role, now it works.
Author
Owner

@its-sven commented on GitHub (May 7, 2026):

I think this is a different feature from what was originally requested.

The current JWT/client_roles based sync appears to create or synchronize NetBird groups from IdP claims. That is useful for group-based access policies, but it does not seem to map an IdP/Azure group to a NetBird account role such as Admin or Owner.

What we are looking for is native role mapping based on IdP/Azure group membership. For example, if a user is member of an Azure group like "NetBird Admins", NetBird should automatically assign that user the NetBird "Admin" role during login or sync.

So the requested feature is not just syncing IdP groups into NetBird groups, but automatically assigning NetBird user roles based on IdP group membership.

<!-- gh-comment-id:4398013434 --> @its-sven commented on GitHub (May 7, 2026): I think this is a different feature from what was originally requested. The current JWT/client_roles based sync appears to create or synchronize NetBird groups from IdP claims. That is useful for group-based access policies, but it does not seem to map an IdP/Azure group to a NetBird account role such as Admin or Owner. What we are looking for is native role mapping based on IdP/Azure group membership. For example, if a user is member of an Azure group like "NetBird Admins", NetBird should automatically assign that user the NetBird "Admin" role during login or sync. So the requested feature is not just syncing IdP groups into NetBird groups, but automatically assigning NetBird user roles based on IdP group membership.
Author
Owner

@jnfrati commented on GitHub (May 8, 2026):

Hey @marcportabellaclotet-mt can we close this one in favor of https://github.com/netbirdio/netbird/issues/5390 ?
The linked issue has much more detailed yet it seems to be exactly what you're looking for

<!-- gh-comment-id:4407737061 --> @jnfrati commented on GitHub (May 8, 2026): Hey @marcportabellaclotet-mt can we close this one in favor of https://github.com/netbirdio/netbird/issues/5390 ? The linked issue has much more detailed yet it seems to be exactly what you're looking for
Author
Owner

@marcportabellaclotet-mt commented on GitHub (May 8, 2026):

Closing in favor of #5390

<!-- gh-comment-id:4408132152 --> @marcportabellaclotet-mt commented on GitHub (May 8, 2026): Closing in favor of #5390
Sign in to join this conversation.
No Label feature-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#4205