Skip to content

triauth for HeadscaleOIDC

Let your team add their devices to your private network with one approval on their own device, and no Headscale passwords.

  • Access and networking
  • Open source
Sign-in through
OpenID Connect bridge
Available in
Every Headscale installation
Set up in
config.yaml

About Headscale

Headscale is a self-hosted replacement for the coordination server behind Tailscale, the private network that connects a team's laptops, servers, and phones. People keep using the regular Tailscale apps, while the sign-in and the device list stay on a server of your own. It is a community project and is not associated with Tailscale Inc.

Connect Headscale to triauth

Headscale signs people in through the triauth OpenID Connect bridge. When someone adds a device with the Tailscale app, the app opens a page on your Headscale, which sends them straight to the bridge. They type their username, approve on their own device, and the new device joins the network. Nobody keeps a Headscale password, and when someone leaves, removing their identity records at your domain stops them from adding devices.

How it works

  1. Open oidc.triauth.org and enter your domain. Paste Headscale's redirect address, https://headscale.example.com/oidc/callback with your own Headscale address in place of headscale.example.com, and click Connect app. The bridge gives you a client ID and a client secret.

  2. On your server, add the section below to Headscale's config.yaml and restart Headscale. Replace example.com with your domain and the two placeholders with the client ID and the client secret from the bridge.

    yaml
    oidc:
      issuer: "https://oidc.triauth.org/example.com"
      client_id: "<client ID from the bridge>"
      client_secret: "<client secret from the bridge>"
      scope: ["openid", "profile", "email"]
  3. On a device, run tailscale up --login-server https://headscale.example.com or sign in from the Tailscale app, and follow the link it shows.

Checkpoint

The link from the Tailscale app opens a page from the bridge that asks for the username, and the person's authenticator asks them to approve. Headscale then confirms that the device has been registered.

Good to know

  • Everyone with an identity at your domain gets a Headscale user at their first sign-in and can add devices. To let only one team in, limit the app to a group when you connect it, or list the groups published at your domain under allowed_groups.
  • A registered device stays in the network until the expiry you set in Headscale, independent of the sign-in. The person signs in again only when a device expires or a new one joins.
  • Headscale takes one sign-in provider, so the bridge replaces any other provider you had.

For the person who connects the app

SettingValue
Redirect addresshttps://<your-headscale>/oidc/callback
Where in Headscalethe oidc section of config.yaml
Issuerhttps://oidc.triauth.org/<your domain>, from which Headscale reads the rest
Expirykeep use_expiry_from_token at false, its default, and set node.expiry instead. The bridge's ID token lives ten minutes, and devices would expire with it
Groupsadd groups to scope and list the allowed groups under allowed_groups. Groups cannot be used in access rules
PKCEoptional, pkce.enabled: true with the default S256 method

Headscale keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. Headscale's OpenID Connect reference explains every key, including the username rules and the filters.

Next steps

All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.