Skip to content

Preauth keys for different users #1310

Closed
@QZAiXH

Description

Bug description
I have two preauth keys A and B, and a new client. I first use A to join headscale and this client successfully joins user A. After that I use B on the client and the client does not switch to user B, it is still on A. Is this correct?

Activity

ItsShadowCone

ItsShadowCone commented on Apr 7, 2023

@ItsShadowCone

Furthermore fast account switching with multiple users on the same headscale instance is currently not working (afaict).

I suspect the same reason under the hood, headscale might be using the machine id/key for a more unique identifier than it should be.

I tested:

  • joining via preauth key, subsequent login via preauth key for second user -> no user switch, no second account, just a renegotiation of node key
  • joining via preauth key, subsequent login via OIDC -> oidc fails, in the log i see could not register machine error="machine was previously registered with a different user"
  • joining via OIDC, subsequent login via preauth key -> same as Bump websocket-extensions from 0.1.3 to 0.1.4 in /frontend #1. preauth key changes nothing, except for the node key.
pallabpain

pallabpain commented on Apr 16, 2023

@pallabpain
Contributor

You should be able to fast-switch users seamlessly if you do the following after logging in with preauth key A.

tailscale logout
tailscale down

tailscale up --auth-key preauthkey-B ... 

I've written an implementation that does exactly this in one of the projects that I am working on.

ItsShadowCone

ItsShadowCone commented on Apr 17, 2023

@ItsShadowCone

I tried it today on headscale 0.21.0 and it does not work. tailscale switch --list only shows a single user.

Carseason

Carseason commented on Apr 28, 2023

@Carseason

me to

github-actions

github-actions commented on Oct 26, 2023

@github-actions
Contributor

This issue is stale because it has been open for 180 days with no activity.

ItsShadowCone

ItsShadowCone commented on Oct 29, 2023

@ItsShadowCone

i believe it is still relevant however

github-actions

github-actions commented on Jan 28, 2024

@github-actions
Contributor

This issue is stale because it has been open for 90 days with no activity.

ItsShadowCone

ItsShadowCone commented on Feb 1, 2024

@ItsShadowCone

Did anyone test this for v0.23.0?

21 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Participants

    @kradalby@pallabpain@ItsShadowCone@QZAiXH@Carseason

    Issue actions

      Preauth keys for different users · Issue #1310 · juanfont/headscale