OIDC compatible mode for IdP data extraction and synchronization #940

Open
opened 2025-11-20 05:20:16 -05:00 by saavagebueno · 6 comments
Owner

Originally created by @oddlama on GitHub (May 29, 2024).

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

When using self-hosted netbird there are a lot of choices for which IdP to use. Only a select few of them can currently be used with netbird's user synchronization, because it requires talking to the IdP through proprietary REST APIs. Not all IdP provide such an API and sometimes users might not want to synchronize all users from the IdP into netbird. See #2057 for the issue where this idea came up.

Currently this means that account data such as email or username is never synchronized and it is impossible to identify users:

image

Describe the solution you'd like

I would like to propose adding a OIDC-compatible mode, which can work with any IdP that supports OIDC and without requiring it to support any additional API and by extension no explicit support from netbird. By default the user list just stays unpopulated and whenever a user successfully authenticates, their information (mostly username & email) is automatically synchronized via the IdP by just updating it to whatever the JWT authentication token contains.

This is also how most other OIDC applications (grafana, forgejo/gitea, ...) work. The downside is of course that users need to login at least once to show up in netbird, but the upsides are that it will work with any IdP and only users that are actually allowed to use netbird will be synchronized.

In OIDC compatible mode, the user account should always be identified by the sub claim, and their username and email would automatically reflect the preferred_username and email claims (possibly configurable). When these values get updated in the IdP, netbird can just automatically update them each time the user authenticates.

By using the JWT group sync feature, one can also still pre-configure stuff for users that have never authenticated, so the downside is really just that users are not immediately displayed which is probably the expectation by self-hosters anyway.

Describe alternatives you've considered

The alternative is to proxy a supported IdP between the actual IdP I'd like to use and netbird, but that causes a lot of friction and introduces numerous points of failure. Without being familiar with netbird's internals I would still assume the feature to be quite simple to implement since the required data is already available in the JWT token netbird receives and processes.

Originally created by @oddlama on GitHub (May 29, 2024). **Is your feature request related to a problem? Please describe.** When using self-hosted netbird there are a lot of choices for which IdP to use. Only a select few of them can currently be used with netbird's user synchronization, because it requires talking to the IdP through proprietary REST APIs. Not all IdP provide such an API and sometimes users might not want to synchronize all users from the IdP into netbird. See #2057 for the issue where this idea came up. Currently this means that account data such as email or username is never synchronized and it is impossible to identify users: ![image](https://github.com/netbirdio/netbird/assets/31919558/cb2cc4d7-b421-4078-b304-985da3d24d1d) **Describe the solution you'd like** I would like to propose adding a OIDC-compatible mode, which can work with any IdP that supports OIDC and without requiring it to support any additional API and by extension no explicit support from netbird. By default the user list just stays unpopulated and whenever a user successfully authenticates, their information (mostly username & email) is automatically synchronized via the IdP by just updating it to whatever the JWT authentication token contains. This is also how most other OIDC applications (grafana, forgejo/gitea, ...) work. The downside is of course that users need to login at least once to show up in netbird, but the upsides are that it will work with any IdP and only users that are actually allowed to use netbird will be synchronized. In OIDC compatible mode, the user account should always be identified by the `sub` claim, and their username and email would automatically reflect the `preferred_username` and `email` claims (possibly configurable). When these values get updated in the IdP, netbird can just automatically update them each time the user authenticates. By using the JWT group sync feature, one can also still pre-configure stuff for users that have never authenticated, so the downside is really just that users are not immediately displayed which is probably the expectation by self-hosters anyway. **Describe alternatives you've considered** The alternative is to proxy a supported IdP between the actual IdP I'd like to use and netbird, but that causes a lot of friction and introduces numerous points of failure. Without being familiar with netbird's internals I would still assume the feature to be quite simple to implement since the required data is already available in the JWT token netbird receives and processes.
saavagebueno added the feature-request label 2025-11-20 05:20:16 -05:00
Author
Owner

@ds-sebastian commented on GitHub (Aug 17, 2024):

@oddlama I also was trying to migrate to KanIDM, were you able to find a workaround?

@ds-sebastian commented on GitHub (Aug 17, 2024): @oddlama I also was trying to migrate to KanIDM, were you able to find a workaround?
Author
Owner

@oddlama commented on GitHub (Aug 18, 2024):

No unfortunately i didn't find a workaround. I just live with the UUID names for the time being and will wait for this feature before onboarding more users.

@oddlama commented on GitHub (Aug 18, 2024): No unfortunately i didn't find a workaround. I just live with the UUID names for the time being and will wait for this feature before onboarding more users.
Author
Owner

@ds-sebastian commented on GitHub (Feb 12, 2025):

I finally migrated to KanIDM and am now stuck with the UUID problem too. I'm wondering if we could use a different provider in and/or use update-claim-map in KanIDM to trick it somehow?

@ds-sebastian commented on GitHub (Feb 12, 2025): I finally migrated to KanIDM and am now stuck with the UUID problem too. I'm wondering if we could use a different provider in and/or use `update-claim-map` in KanIDM to trick it somehow?
Author
Owner

@ranomier commented on GitHub (Feb 27, 2025):

Same problem with KanIDM, maybe we should create a self help group xD. half /s

@ranomier commented on GitHub (Feb 27, 2025): Same problem with KanIDM, maybe we should create a self help group xD. half /s
Author
Owner

@ds-sebastian commented on GitHub (Feb 27, 2025):

@ranomier, I was successful in getting it to work. Hope this helps!
https://github.com/netbirdio/netbird/issues/2057#issuecomment-2661232209

@ds-sebastian commented on GitHub (Feb 27, 2025): @ranomier, I was successful in getting it to work. Hope this helps! https://github.com/netbirdio/netbird/issues/2057#issuecomment-2661232209
Author
Owner

@mjohnson9 commented on GitHub (Jun 17, 2025):

I’m also interested in having Netbird work smoothly with Kanidm. I saw that Kanidm has SCIM endpoints. SCIM is a standardized format for syncing user data between an identity provider (like Kanidm) and a relying party (like Netbird). I’m not sure if Kanidm’s SCIM support is complete yet, as their ticket is still open, but the endpoints do respond to requests in currently released versions. Unfortunately, though, it seems that SCIM support in Netbird is gated as an enterprise feature unavailable in the self-hosted version (ref #3310).

@mjohnson9 commented on GitHub (Jun 17, 2025): I’m also interested in having Netbird work smoothly with Kanidm. I saw that Kanidm has SCIM endpoints. SCIM is a standardized format for syncing user data between an identity provider (like Kanidm) and a relying party (like Netbird). I’m not sure if Kanidm’s SCIM support is complete yet, as their ticket is still open, but the endpoints do respond to requests in currently released versions. Unfortunately, though, it seems that SCIM support in Netbird is gated as an enterprise feature unavailable in the self-hosted version (ref #3310).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#940