Self hosted keycloak integration shows user ID under email in netbird ui #190

Closed
opened 2025-11-20 05:07:39 -05:00 by saavagebueno · 5 comments
Owner

Originally created by @finnje on GitHub (Sep 13, 2022).

For some reason keycloak users info is not being pulled properly when displayed in the netbird ui

Keycloak UI

Screen Shot 2022-09-13 at 9 16 49 AM

Netbird UI

Screen Shot 2022-09-13 at 9 12 10 AM

I would expect the email address seen in keycloak to be displayed under email in the netbird instead of the ID and likely the username from keycloak to be displayed under Name in netbird.

Originally created by @finnje on GitHub (Sep 13, 2022). For some reason keycloak users info is not being pulled properly when displayed in the netbird ui **Keycloak** UI ![Screen Shot 2022-09-13 at 9 16 49 AM](https://user-images.githubusercontent.com/4070974/189911278-15a81fb9-0af7-48b8-90a9-c94c57490c49.png) **Netbird** UI ![Screen Shot 2022-09-13 at 9 12 10 AM](https://user-images.githubusercontent.com/4070974/189910279-aad30f39-70c0-4449-a10a-d2197a7fc7a8.png) I would expect the email address seen in keycloak to be displayed under _email_ in the netbird instead of the _ID_ and likely the _username_ from keycloak to be displayed under _Name_ in netbird.
saavagebueno added the enhancementmanagement-servicehelp wantedintegrations labels 2025-11-20 05:07:39 -05:00
Author
Owner

@braginini commented on GitHub (Sep 14, 2022):

hey @finnje
Thank you for reporting this!

This is the expected behavior so far. The Keycloak API integration is not yet there, and UI uses ID to display in the Email column. Not ideal, but works.
NetBird doesn't store any user data, instead, it relies on the underlying IdP. The API integrations are in the IdP package and there is only one implementation - Auth0.

We didn't set the priority for this issue. We'd appreciate it if someone from the community could implement the IdP Manager interface for Keycloak using this official Keycloak API reference.

@braginini commented on GitHub (Sep 14, 2022): hey @finnje Thank you for reporting this! This is the expected behavior so far. The Keycloak API integration is not yet there, and UI uses ID to display in the Email column. Not ideal, but works. NetBird doesn't store any user data, instead, it relies on the underlying IdP. The API integrations are in the [IdP package](https://github.com/netbirdio/netbird/tree/main/management/server/idp) and there is only one implementation - Auth0. We didn't set the priority for this issue. We'd appreciate it if someone from the community could implement the [IdP Manager interface](https://github.com/netbirdio/netbird/blob/6de313070a4e20e50e523b3e41de875e727a96f1/management/server/idp/idp.go#L11) for Keycloak using this official [Keycloak API reference](https://www.keycloak.org/docs-api/15.0/rest-api/#_users_resource).
Author
Owner

@pnowy commented on GitHub (Nov 14, 2022):

@finnje you can change it on Keycloak side. What is needed in this case is a client specific mapper which put into sub the email or username (email probably is better as sub is displayed on email column on NetBird UI).

Example config from Keycloak (Client -> Your Client (i.e. netbird-client)-> Client Scopes -> netbird-client-dedicated -> Add mapper -> By Configuration -> User Property):

image

@pnowy commented on GitHub (Nov 14, 2022): @finnje you can change it on Keycloak side. What is needed in this case is a client specific mapper which put into `sub` the email or username (email probably is better as `sub` is displayed on email column on NetBird UI). Example config from Keycloak (Client -> Your Client (i.e. `netbird-client`)-> Client Scopes -> netbird-client-dedicated -> Add mapper -> By Configuration -> User Property): ![image](https://user-images.githubusercontent.com/3254609/201652432-020a3389-2720-431b-9b5d-8cd75cf0d212.png)
Author
Owner

@finnje commented on GitHub (Nov 14, 2022):

Nice @pnowy thanks for that!

@finnje commented on GitHub (Nov 14, 2022): Nice @pnowy thanks for that!
Author
Owner

@mlsmaycon commented on GitHub (Jun 16, 2023):

@finnje we've added a better integration for keycloak with the latest versions. Please refer to: https://docs.netbird.io/selfhosted/identity-providers#step-9-add-manage-users-role-to-netbird-backend

@mlsmaycon commented on GitHub (Jun 16, 2023): @finnje we've added a better integration for keycloak with the latest versions. Please refer to: https://docs.netbird.io/selfhosted/identity-providers#step-9-add-manage-users-role-to-netbird-backend
Author
Owner

@bravosierrasierra commented on GitHub (May 14, 2024):

@mlsmaycon Can you add solution from https://github.com/netbirdio/netbird/issues/469#issuecomment-1313561452 to https://docs.netbird.io/selfhosted/identity-providers#keycloak ? I spend many days to find a solution for empty username from keycloak :(

@bravosierrasierra commented on GitHub (May 14, 2024): @mlsmaycon Can you add solution from https://github.com/netbirdio/netbird/issues/469#issuecomment-1313561452 to https://docs.netbird.io/selfhosted/identity-providers#keycloak ? I spend many days to find a solution for empty username from keycloak :(
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#190