pulling in user information from Dex IdP #1419

Open
opened 2025-11-20 05:29:58 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @H777K on GitHub (Nov 18, 2024).

Hi,
I am using a self-hosted Netbird setup with dex as IdP. The configuration is similar as described by @Thunderbottom in issue #898, which works good. The only difference is, that I use the BuiltIn (Local) connector instead of google.

However, I have noticed two things:

  1. The login persists only in the current browser tab, if I open a new tab, I need to login again.
  2. The Email address is not set for my user, which leads to the following error in the management log:
    management/server/http/events_handler.go:84: failed to resolve email for initiator: 0123456789

Any ideas how to solve this?

Originally created by @H777K on GitHub (Nov 18, 2024). Hi, I am using a self-hosted Netbird setup with dex as IdP. The configuration is similar as described by @Thunderbottom in issue #898, which works good. The only difference is, that I use the BuiltIn (Local) connector instead of google. However, I have noticed two things: 1. The login persists only in the current browser tab, if I open a new tab, I need to login again. 2. The Email address is not set for my user, which leads to the following error in the management log: `management/server/http/events_handler.go:84: failed to resolve email for initiator: 0123456789` Any ideas how to solve this?
saavagebueno added the feature-requestidpconfig-idp labels 2025-11-20 05:29:58 -05:00
Author
Owner

@Thunderbottom commented on GitHub (Nov 18, 2024):

Hi, although we have moved away from Dex IdP to the Google login flow, I'll try to help you out here.

  1. Can you tell me if alwaysShowLoginScreen here is set to false, if not, you will probably need to set that to make this work.
  2. This I'm not really sure about, but it seems like you'll probably need to set the email ID in the configuration as specified here

I believe this is just a minor configuration issue.

@Thunderbottom commented on GitHub (Nov 18, 2024): Hi, although we have moved away from Dex IdP to the Google login flow, I'll try to help you out here. 1. Can you tell me if `alwaysShowLoginScreen` [here](https://dexidp.io/docs/configuration/oauth2) is set to `false`, if not, you will probably need to set that to make this work. 2. This I'm not really sure about, but it seems like you'll probably need to set the email ID in the configuration as specified [here](https://dexidp.io/docs/connectors/local/) I believe this is just a minor configuration issue.
Author
Owner

@H777K commented on GitHub (Nov 18, 2024):

Hi @Thunderbottom, really appreciate your reply!

Yes alwaysShowLoginScreen is set to false and the email is set in the staticPasswords section.

I have made some further observations:

  1. I assume that this is related to how the OIDC flow is done with dex, since dex can not be configured in the IdpManagerConfig section of the management server. Therefore the dashboard takes care of it instead of the management server. The oidc.token will be set in the session storage, so if I open a new tab, the session storage of course is empty and a new login is required. I also have a second Netbird stack with zitadel as IdP. Zitadel sets some cookies, which allow to "rebuild" the session storage and automatically login again without entering the credentials.
  2. The email claim is set correctly in the JWT. So I assume, that Netbird does not do any mapping with the email claim. It only uses the specifed claim in the httpConfig as UserID e.g.: "AuthUserIDClaim": "email"

Therefore I am not really sure, if this is a configuration issue.

@H777K commented on GitHub (Nov 18, 2024): Hi @Thunderbottom, really appreciate your reply! Yes `alwaysShowLoginScreen` is set to `false` and the email is set in the `staticPasswords` section. I have made some further observations: 1. I assume that this is related to how the OIDC flow is done with dex, since dex can not be configured in the `IdpManagerConfig` section of the management server. Therefore the dashboard takes care of it instead of the management server. The `oidc.token` will be set in the session storage, so if I open a new tab, the session storage of course is empty and a new login is required. I also have a second Netbird stack with zitadel as IdP. Zitadel sets some cookies, which allow to "rebuild" the session storage and automatically login again without entering the credentials. 2. The `email` claim is set correctly in the JWT. So I assume, that Netbird does not do any mapping with the email claim. It only uses the specifed claim in the httpConfig as UserID e.g.: `"AuthUserIDClaim": "email"` Therefore I am not really sure, if this is a configuration issue.
Author
Owner

@Thunderbottom commented on GitHub (Nov 18, 2024):

Hm, then I suggest you check out if there's any similar issues on the Dex IdP repository, since that would be a better place to ask about this issue. In the meanwhile, I too shall try to figure out if there's anything I can find and update here.

@Thunderbottom commented on GitHub (Nov 18, 2024): Hm, then I suggest you check out if there's any similar issues on the Dex IdP repository, since that would be a better place to ask about this issue. In the meanwhile, I too shall try to figure out if there's anything I can find and update here.
Author
Owner

@nazarewk commented on GitHub (Mar 19, 2025):

I'll hijack this issue on behalf of becoming a feature request for pulling in user data from Dex, specifically:

The email claim is set correctly in the JWT. So I assume, that Netbird does not do any mapping with the email claim. It only uses the specifed claim in the httpConfig as UserID e.g.: "AuthUserIDClaim": "email"

I got feedback from the developer that it is not currently possible to retrieve/register user information from arbitrary identity providers.

As a piece of background, user data used to be pulled in from the authentication responses in the initial implementation but was quickly abandoned due to some issues with this approach (or the specific implementation created back then).

It is only possible for a list of well-supported (aka implemented specifically) identity providers and Dex is not yet one of them.

@nazarewk commented on GitHub (Mar 19, 2025): I'll hijack this issue on behalf of becoming a feature request for pulling in user data from Dex, specifically: > The email claim is set correctly in the JWT. So I assume, that Netbird does not do any mapping with the email claim. It only uses the specifed claim in the httpConfig as UserID e.g.: "AuthUserIDClaim": "email" I got feedback from the developer that it is not currently possible to retrieve/register user information from arbitrary identity providers. As a piece of background, user data used to be pulled in from the authentication responses in the initial implementation but was quickly abandoned due to some issues with this approach (or the specific implementation created back then). It is only possible for a list of well-supported (aka implemented specifically) identity providers and Dex is not yet one of them.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#1419