[GH-ISSUE #4799] 0.59.12 client login hint breaks login when username is not equal to email #9838

Open
opened 2026-08-05 01:23:40 -04:00 by saavagebueno · 10 comments
Owner

Originally created by @ssn-github on GitHub (Nov 17, 2025).
Original GitHub issue: https://github.com/netbirdio/netbird/issues/4799

Describe the problem
Since this change in 0.59.12: [client] Add login_hint to oidc flows https://github.com/netbirdio/netbird/pull/4724

Some users are unable authenticate with Azure/Entra because the login_hint parameter added to the url uses the email address instead of the username.

I tried to add "LoginHint": "" to the management.json PKCEAuthorizationFlow part, because I found a check if p.providerConfig.LoginHint != "" in the code but that didn't change the behavior.
It works once for new users or if I delete the PROFILE.state.json file which contains the info for the login hint. Also if I manually remove the login_hint parameter from the url it works as well.

Is there any other way to not use the login_hint in the url or to configure it using another attribute than email? Or am I just using the LoginHint parameter in the management.json wrong?

To Reproduce

Steps to reproduce the behavior:

  1. Have at least client 0.59.12 and azure/entra authentication where some users do not have their email as the username
  2. Click on connect
  3. browser opens login.microsoftonline.com but it doesn't recognize the username and so fails to authenticate

Expected behavior

Either an option to not use login_hint (similar to DisablePromptLogin) or use the username instead of email for the hint

Are you using NetBird Cloud?

self-hosted

NetBird version

0.59.13, latest docker images

Is any other VPN software installed?

no

Additional context

Clients are Windows 11 with Entra Seamless-SSO, so they usually do not need to enter their username or password but instead are automatically authenticated with their current Windows session.
I also use DisablePromptLogin: true in the management.json

Have you tried these troubleshooting steps?

  • [x ] Reviewed client troubleshooting (if applicable)
  • [x ] Checked for newer NetBird versions
  • [x ] Searched for similar issues on GitHub (including closed ones)
  • [ x] Restarted the NetBird client
  • [ x] Disabled other VPN software
  • [ x] Checked firewall settings
Originally created by @ssn-github on GitHub (Nov 17, 2025). Original GitHub issue: https://github.com/netbirdio/netbird/issues/4799 **Describe the problem** Since this change in 0.59.12: [client] Add login_hint to oidc flows https://github.com/netbirdio/netbird/pull/4724 Some users are unable authenticate with Azure/Entra because the login_hint parameter added to the url uses the email address instead of the username. I tried to add "LoginHint": "" to the management.json PKCEAuthorizationFlow part, because I found a check `if p.providerConfig.LoginHint != ""` in the code but that didn't change the behavior. It works once for new users or if I delete the PROFILE.state.json file which contains the info for the login hint. Also if I manually remove the login_hint parameter from the url it works as well. Is there any other way to not use the login_hint in the url or to configure it using another attribute than email? Or am I just using the LoginHint parameter in the management.json wrong? **To Reproduce** Steps to reproduce the behavior: 1. Have at least client 0.59.12 and azure/entra authentication where some users do not have their email as the username 2. Click on connect 3. browser opens login.microsoftonline.com but it doesn't recognize the username and so fails to authenticate **Expected behavior** Either an option to not use login_hint (similar to DisablePromptLogin) or use the username instead of email for the hint **Are you using NetBird Cloud?** self-hosted **NetBird version** 0.59.13, latest docker images **Is any other VPN software installed?** no **Additional context** Clients are Windows 11 with Entra Seamless-SSO, so they usually do not need to enter their username or password but instead are automatically authenticated with their current Windows session. I also use DisablePromptLogin: true in the management.json **Have you tried these troubleshooting steps?** - [x ] Reviewed [client troubleshooting](https://docs.netbird.io/how-to/troubleshooting-client) (if applicable) - [x ] Checked for newer NetBird versions - [x ] Searched for similar issues on GitHub (including closed ones) - [ x] Restarted the NetBird client - [ x] Disabled other VPN software - [ x] Checked firewall settings
saavagebueno added the triage-needed label 2026-08-05 01:23:40 -04:00
Author
Owner

@azmarifuzzaman commented on GitHub (Nov 17, 2025):

We also have the same issue with OKTA for our self hosted Netbird. I came here to create an issue, and found this! :)
Thanks!

We tested by changing in the code;
so I extracted "preferred_username" instead of "email" and changed the name too in respective places, and built the binary for linux, it works and the state file now I have:

Image

But today we found a better workaround in OKTA configuration; so we could map the "email" claim to "user.login" in OKTA settings for our Netbird app. With this in place, now Netbird works like before, so we get the login_hint as our actual login, not the email. So we don't need to create our own binary/rpm eventually.

<!-- gh-comment-id:3544285727 --> @azmarifuzzaman commented on GitHub (Nov 17, 2025): We also have the same issue with OKTA for our self hosted Netbird. I came here to create an issue, and found this! :) Thanks! We tested by changing in the code; so I extracted "preferred_username" instead of "email" and changed the name too in respective places, and built the binary for linux, it works and the state file now I have: <img width="581" height="121" alt="Image" src="https://github.com/user-attachments/assets/6168eab8-2a10-4e09-87fd-76a93a3a1b67" /> But today we found a better workaround in OKTA configuration; so we could map the "email" claim to "user.login" in OKTA settings for our Netbird app. With this in place, now Netbird works like before, so we get the login_hint as our actual login, not the email. So we don't need to create our own binary/rpm eventually.
Author
Owner

@saule1508 commented on GitHub (Nov 17, 2025):

Indeed, the code cannot assume that email is used to login to the OIDC provider, it should be configurable.
Since okta already has the "Remember me" function (which stores the user in local storage), the login_hint does not bring extra value for us so ability to disable it would be good enough

<!-- gh-comment-id:3544574809 --> @saule1508 commented on GitHub (Nov 17, 2025): Indeed, the code cannot assume that email is used to login to the OIDC provider, it should be configurable. Since okta already has the "Remember me" function (which stores the user in local storage), the login_hint does not bring extra value for us so ability to disable it would be good enough
Author
Owner

@sisumara commented on GitHub (Nov 19, 2025):

It seems that I have a similar issue with Zitadel on 59.12 or higher client. Is there any changes which should be done on IDP side or management configuration?

<!-- gh-comment-id:3550993519 --> @sisumara commented on GitHub (Nov 19, 2025): It seems that I have a similar issue with Zitadel on 59.12 or higher client. Is there any changes which should be done on IDP side or management configuration?
Author
Owner

@azmarifuzzaman commented on GitHub (Nov 20, 2025):

Hi @sisumara
You can check in Zitadel/IDP side if you can map the login/username to emial claim, like we did for Okta. That would fix yours.

<!-- gh-comment-id:3560404228 --> @azmarifuzzaman commented on GitHub (Nov 20, 2025): Hi @sisumara You can check in Zitadel/IDP side if you can map the login/username to emial claim, like we did for Okta. That would fix yours.
Author
Owner

@jlundstrom commented on GitHub (Dec 12, 2025):

I've been looking into patching this, the easiest thing is expending the list of possible fields that can be used. Azure has an optional field for login_hint which is the recommended value and a preferred_username which should be more consistent then email. The current implementation also uses this value as a display string, so a new value would need to be added for the login hint.

The more permanent fix would be adding another config value to PKCEAuthorizationFlow there is a stubbed out entry for LoginHint that is being populated. It is not a part of the Management.proto ProviderConfig. I think adding a LoginHintClaim config entry to the ProviderConfig would be the cleanest, and change the logic to only use that field if populated. We could do something similar with the current email field but mark it as a Display Name populated by a DisplayNameClaim service administrators can pick if it's an email or name. Changing the configs someone needs to make a call for what the default should be, or if the config value should be a list of strings to preserve the default behavior.

db3dab4853

<!-- gh-comment-id:3648061468 --> @jlundstrom commented on GitHub (Dec 12, 2025): I've been looking into patching this, the easiest thing is expending the list of possible fields that can be used. Azure has an optional field for login_hint which is the recommended value and a preferred_username which should be more consistent then email. The current implementation also uses this value as a display string, so a new value would need to be added for the login hint. The more permanent fix would be adding another config value to [PKCEAuthorizationFlow](https://github.com/netbirdio/netbird/blob/main/client/internal/pkce_auth.go#L47) there is a stubbed out entry for LoginHint that is being populated. It is not a part of the Management.proto [ProviderConfig](https://github.com/netbirdio/netbird/blob/main/shared/management/proto/management.proto#L382). I think adding a LoginHintClaim config entry to the ProviderConfig would be the cleanest, and change the logic to only use that field if populated. We could do something similar with the current email field but mark it as a Display Name populated by a DisplayNameClaim service administrators can pick if it's an email or name. Changing the configs someone needs to make a call for what the default should be, or if the config value should be a list of strings to preserve the default behavior. https://github.com/jlundstrom/netbird/commit/db3dab485360dae7f12c5c4b8a706143bf53d761
Author
Owner

@ressys1978 commented on GitHub (Feb 2, 2026):

I too am afflicted by this, it's an annoyance to my users.

@pappz since you wrote the Feature Enhancement to add the login_hint functionality, would it be possible for you modify the functionality of it to either allow the login_hint to be something other than Email, or to a way to disable/enable to the login_hint functionality?

<!-- gh-comment-id:3835171393 --> @ressys1978 commented on GitHub (Feb 2, 2026): I too am afflicted by this, it's an annoyance to my users. @pappz since you wrote the Feature Enhancement to add the login_hint functionality, would it be possible for you modify the functionality of it to either allow the login_hint to be something other than Email, or to a way to disable/enable to the login_hint functionality?
Author
Owner

@tnakeli commented on GitHub (Feb 4, 2026):

I am using "DisablePromptLogin" and want to have user signed in using existing login session (single sign-on) in Entra.

Now login_hint points to email, which is not actual login account in our environment and user is prompted to login even that existing Entra authenticaiton is valid for the user. Everything works expected if login_hint is missing or points to proper username.

<!-- gh-comment-id:3847933430 --> @tnakeli commented on GitHub (Feb 4, 2026): I am using "DisablePromptLogin" and want to have user signed in using existing login session (single sign-on) in Entra. Now login_hint points to email, which is not actual login account in our environment and user is prompted to login even that existing Entra authenticaiton is valid for the user. Everything works expected if login_hint is missing or points to proper username.
Author
Owner

@tnakeli commented on GitHub (Feb 14, 2026):

Hi @lixmal , could you take a look at this issue? You originally implemented this.

Many organizations don’t use an email address as the login identifier. With Entra, when combined with DisablePromptLogin, the login_hint value breaks reuse of the existing browser session and the user gets prompted for credentials even though the browser is already signed in.

Also, with Windows Hello for Business, this causes the user to be redirected to password login, and passwordless sign-in doesn’t work because login_hint points to the wrong username.

All of the above is resolved if we omit login_hint. Could we add a configuration option to suppress login_hint, similar to DisablePromptLogin?

<!-- gh-comment-id:3901316720 --> @tnakeli commented on GitHub (Feb 14, 2026): Hi @lixmal , could you take a look at this issue? You originally implemented this. Many organizations don’t use an email address as the login identifier. With Entra, when combined with `DisablePromptLogin`, the `login_hint `value breaks reuse of the existing browser session and the user gets prompted for credentials even though the browser is already signed in. Also, with Windows Hello for Business, this causes the user to be redirected to password login, and passwordless sign-in doesn’t work because `login_hint `points to the wrong username. All of the above is resolved if we omit `login_hint`. Could we add a configuration option to suppress `login_hint`, similar to `DisablePromptLogin`?
Author
Owner

@prince7395 commented on GitHub (Mar 9, 2026):

Environment

NetBird: self‑hosted (production)
IdP: Microsoft Entra ID (Azure AD)
Users: ~600 internal + external (guests)

Problem Summary
Our Entra ID sign‑in flow often auto‑prefills an email address (via login_hint) that belongs to a personal Microsoft account (MSA), not to the user’s corporate Entra ID account. In our tenant email ≠ UPN.

On first login after install, users can enter UPN + password and it works.
On subsequent logins, clicking Connect opens Microsoft’s page already filled with the email, shows only the password box, and doesn’t allow switching the account. Any attempt fails because it tries to authenticate the MSA that happens to use the same email, instead of the corporate UPN.

Two affected scenarios

Employees who once created a personal Microsoft account using their work email. NetBird/Entra fills that email and won’t let them change to UPN.
External users (guests): in our directory we store their contact email (e.g., xyz@gmail.com). If that Gmail is also a personal Microsoft account, the login page is prefilled with that address and the user cannot replace it with the guest UPN we issued.

Extra symptoms

NetBird tray shows the email next to the profile, not the UPN.
Opening the login in Incognito doesn’t help—login_hint still prepopulates and blocks changing the username.

Current workaround
For employees who used their work email to create a personal Microsoft account, we sign into that personal MSA and change the primary alias away from the work email (e.g., to an @outlook.com). After that, NetBird stops pre‑filling, and the user can enter UPN + password. This is not scalable.
Impact
Production outage risk for ~600 users; recurring helpdesk escalations. We need a solution that doesn’t break existing peers.

What we need
Option to use UPN (e.g., read upn claim) for display/hint instead of email, or
Option to disable login_hint entirely, or
Always force account selection (e.g., prompt=select_account) so users can pick the correct corporate UPN each time, or
A setting that ensures the login field is empty every time so the user must type UPN + password.

Notes

This only starts happening after the first successful login; fresh installs allow typing UPN.
We’re looking for a server‑side/configurable fix that’s safe in production.

<!-- gh-comment-id:4024414251 --> @prince7395 commented on GitHub (Mar 9, 2026): Environment NetBird: self‑hosted (production) IdP: Microsoft Entra ID (Azure AD) Users: ~600 internal + external (guests) Problem Summary Our Entra ID sign‑in flow often auto‑prefills an email address (via login_hint) that belongs to a personal Microsoft account (MSA), not to the user’s corporate Entra ID account. In our tenant email ≠ UPN. On first login after install, users can enter UPN + password and it works. On subsequent logins, clicking Connect opens Microsoft’s page already filled with the email, shows only the password box, and doesn’t allow switching the account. Any attempt fails because it tries to authenticate the MSA that happens to use the same email, instead of the corporate UPN. Two affected scenarios Employees who once created a personal Microsoft account using their work email. NetBird/Entra fills that email and won’t let them change to UPN. External users (guests): in our directory we store their contact email (e.g., xyz@gmail.com). If that Gmail is also a personal Microsoft account, the login page is prefilled with that address and the user cannot replace it with the guest UPN we issued. Extra symptoms NetBird tray shows the email next to the profile, not the UPN. Opening the login in Incognito doesn’t help—login_hint still prepopulates and blocks changing the username. Current workaround For employees who used their work email to create a personal Microsoft account, we sign into that personal MSA and change the primary alias away from the work email (e.g., to an @outlook.com). After that, NetBird stops pre‑filling, and the user can enter UPN + password. This is not scalable. Impact Production outage risk for ~600 users; recurring helpdesk escalations. We need a solution that doesn’t break existing peers. What we need Option to use UPN (e.g., read upn claim) for display/hint instead of email, or Option to disable login_hint entirely, or Always force account selection (e.g., prompt=select_account) so users can pick the correct corporate UPN each time, or A setting that ensures the login field is empty every time so the user must type UPN + password. Notes This only starts happening after the first successful login; fresh installs allow typing UPN. We’re looking for a server‑side/configurable fix that’s safe in production.
Author
Owner

@aj-bi commented on GitHub (Apr 20, 2026):

we have the same problem and we would be happy for a FIX!

<!-- gh-comment-id:4278970453 --> @aj-bi commented on GitHub (Apr 20, 2026): we have the same problem and we would be happy for a FIX!
Sign in to join this conversation.
No Label triage-needed
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#9838