-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in user switching during OIDC authentication #1522
Comments
Can confirm I am coming across this as well. I was just about to submit a bug report but came across this. |
same for me. just had this as well |
Any update on this? |
This bug "hit" me as well yesterday... |
I'm having a similar problem: Headscale is installed and working (headscale v0.23.0-alpha5, on debian 12.4). OIDC is set up using Google Workspace as the provider. Install tailscale client for windows (1.6.2). Set registry values to point to my headscale server. Select Login from the tailscale client menu.. it does OIDC auth in the browser.. authenticate using SAME google user as before, it works. Everything works as configured (nodes can see each other, subnet route works, and configured dns server is used). (Amazing.. loving this.. thanks!). Headscale shows two nodes up and one user, as expected. Now I want to log out as my regular user and try logging in as a different user.. this is where the problem comes... Tailscale prompts me to log in.. I click and the oidc page comes up. I select a DIFFERENT account in my workspace domain. I get the validation page from my headscale server "Reauthenticated as [email protected], you can now close this window". Open the tailscale for Windows menu.. it shows that I'm connected NOT as "seconduser" but as "firstuser".. and this is indicated by the headscale admin as well. I'm connected again, but not as the user that I selected (and that appeared on the "Signed in via your OIDC provider" page.... LMK of any solution.. Thanks! EDIT: If I delete the node from headscale then it works.. I am able to login as a different user. PS: While I'm here, I'd like make a related suggestion: In the oidc code, I see that if a user is not found in the headscale database, a new user is inserted. The problem with this is that Google Workspace does not seem to support groups via oidc (for now). So it's not possible to use allowed_groups to control who can authenticate with headscale, everyone in the domain can do it and a user record will be created.. the only way to prevent that is to add an entry for every user under allowed_users in config.yaml. What I would like to see is:
Thanks! (If you are interested in patches I'll make one.. I don't know Go.. but I know a lot of other languages.. it doesn't look too hard....) |
This issue is stale because it has been open for 90 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Any updates on this? Just came across this too, need some way to switch between multiple users. |
One workaround I heard about was running multiple |
Bug description
Hello,
I found an issue in headscale that seems like a bug to me.
As a user, I can't change the OIDC account I'm already authorized with. I'm trying to do it this way:
tailscale logout && tailscale down
tailscale up
with the--login-server
parameter. It redirects me to the OIDC authorization page (https://my-server.com/oidc/register/nodekey:XXXXXXX
)Upon successful authorization, I get an error in the web interface:
could not register machine
, and in the app logs, there's also an error:ERR go/src/headscale/hscontrol/oidc.go:712 > could not register machine error="machine was previously registered with a different user"
The error seems to be here, where it's explicitly forbidden:
headscale/hscontrol/db/machine.go
Lines 381 to 386 in fb203a2
The text was updated successfully, but these errors were encountered: