Help

Integration

Headscale OIDC Integration

Updated 17 Nov 2026 6 min read

This document explains how to implement Monosign with Headscale, the open source, self-hosted implementation of the Tailscale control server (WireGuard based VPN). Headscale has built-in support for OpenID Connect (OIDC), so users register their devices by signing in with Monosign. Headscale uses the Authorization Code flow, so the OIDC/OpenID access key of Monosign is used. Before you continue, it is better to read the Headscale documentation (opens in a new tab).

This configuration was tested with Headscale v0.29.7 (Docker) and the Tailscale client for macOS. If your version is different, please check the Headscale documentation.

Headscale reads the OIDC settings from its configuration file (config.yaml); there is no administration page for it. SAML is not supported by Headscale.

Monofor has no responsibility to do Headscale configurations. If you need support please contact the Headscale community or your Headscale support provider.

Instructions

This documentation contains 5 main steps for integration.

  1. Creating an application on Monosign

  2. Configuring the OIDC/OpenID settings on Monosign

  3. Assign a user to the Headscale application

  4. Configuration Single Sign-On for Headscale

  5. Sign In Test

1- Creating an Application on Monosign

Create your application on Monosign first. Open the Applications page from the left menu and click Add New.

image-20261030-191725.png

Headscale is not in the application catalog, so click Create from scratch.

image-20261030-191750.png

Fill in the application details on the Application tab and click Next.

Property

Value

Description

Name

Headscale

Name of the application shown to users on the Monosign portal and on the Monosign sign-in page.

Type

Web

Options: Web, Mobile, Desktop, API.

Url

Optional

Leave empty or enter the address of Headscale (for example https://<headscale-address>).

Logo

Optional

Browse and upload a logo (PNG or JPG, max 1 MB); it is also shown on the Monosign sign-in page.

Users can see this application on their list

Enabled

Displays the application on the user portal.

On the Access tab keep the defaults (System Default) and click Create Application. Headscale needs the e-mail address, the user name and the name of the user, so the profile attributes must be available to the application.

image-20261030-192040.png

After the application is created, click Keys and add a new Access Key for OIDC/OpenID access.

image-20261030-192203.png

Select OIDC/OpenID as the key type and click Create. Monosign generates the Client Id and Client Secret automatically.

Monosign value

Example

Used in Headscale as

Client Id

<client-id>

client_id

Client Secret

<client-secret>

client_secret

Issuer

https://<monosign-host>/

issuer. Enter the address with the slash at the end; it is the address of the Configuration Url without .well-known/openid-configuration.

2- Configuring the OIDC/OpenID Settings on Monosign

Open the Keys tab of the application and click the Configure button of the OpenID Connect (OIDC) key.

image-20261031-211438.png

Open the OIDC/OpenID Settings tab, enter the scopes in the Scope field (press Enter after each scope), add the callback address of Headscale to Allowed Redirect URIs and press Update.

image-20261117-205435.png

Property

Value

Description

Allowed Redirect URIs

https://<headscale-address>/oidc/callback

The address where Monosign sends the user back after sign-in. <headscale-address> must be the same as server_url of Headscale.

Scope

openid profile email

Enter the three scopes one by one.

Other fields

Empty / default

The other fields are not needed.

3- Assign a User to the Headscale Application

Open the application in Monosign, click the Assignments tab and click Assign a User.

image-20261030-193315.png

Search and select the users who can register devices, check the Expiration Date and save. You can select more than one user. Every user needs an e-mail address in Monosign.

image-20261030-193652.png

4- Configuration Single Sign-On for Headscale

As we mentioned at the start, please check out the Headscale documentation first. Open the Headscale configuration file (config.yaml) and add the oidc block below, then restart Headscale.

oidc:
  only_start_if_oidc_is_available: true
  issuer: "https://<monosign-host>/"
  client_id: "<client-id>"
  client_secret: "<client-secret>"
  email_verified_required: false
  scope: ["openid", "profile", "email"]
  pkce:
    enabled: true
    method: S256

Field

Value

Description

issuer

https://<monosign-host>/

Address of Monosign with the slash at the end.

client_id, client_secret

Client Id, Client Secret

Copied from the Monosign OIDC/OpenID access key created in the first step.

email_verified_required

false

Monosign does not send the email_verified claim. With the default value (true) Headscale rejects the sign-in.

scope

openid, profile, email

Same scopes as in Monosign.

pkce

enabled: true, S256

Optional; Monosign supports PKCE.

If Headscale runs in Docker and the configuration file is mounted, restart the container (for example docker restart headscale). At the start Headscale contacts Monosign and fails to start if the issuer cannot be reached (only_start_if_oidc_is_available).

Headscale takes the user name, e-mail address and name from the preferred_username, email and name claims, so these must be available for the user in Monosign. The Headscale user is created automatically at the first sign-in. To limit who can register, allowed_domains, allowed_users and allowed_groups can be added to the same block.

5- Sign In Test

Headscale does not have a sign-in page. The sign-in starts when a device is registered with the Tailscale client. Install the Tailscale client on the device and tell it to use your Headscale server instead of the Tailscale service.

  1. Command line (Linux, Windows, macOS): run tailscale up --login-server https://<headscale-address>.

  2. Tailscale application for macOS (installed outside the App Store): run defaults write io.tailscale.ipn.macsys ControlURL https://<headscale-address> and restart the application. For the App Store version use io.tailscale.ipn.macos.

Click Sign in to your network in the client (or open the address printed by the command). The client shows Authentication In Progress and opens the browser.

image-20261117-205558.png

The browser opens the Monosign sign-in page. Sign in with your QR code (Monofor Identity), with a Passkey or with your user name and password. If you are already signed in to Monosign, the page is skipped.

image-20261117-205840.png

After the sign-in Monosign redirects the browser back to Headscale (/oidc/callback). Headscale shows the Confirm node registration page with the host name and the operating system of the device and the user it is registered to. Check the details and click Confirm registration.

image-20261117-205653.png

Headscale creates the user at the first sign-in and registers the device. The page Node registered confirms it; you can close the window.

image-20261117-205720.png

The client shows Connected and lists the device under the user in the Devices page.

image-20261117-205748.png

You can also check the result on the Headscale server:

docker exec headscale headscale users list
docker exec headscale headscale nodes list

To sign out, open the Tailscale menu, open the account of the user and click Log out. The next Log in starts the Monosign sign-in again. If you are still signed in to Monosign the password is not asked again; sign out of Monosign as well to see the sign-in page.

The users that sign in through Monosign are separate Headscale users. Real-time (UDP) connections between devices need the Headscale server to be reachable directly; the sign-in itself works through an HTTPS reverse proxy.

Troubleshooting

Symptom

Cause

Solution

Headscale does not start

Monosign cannot be reached or the issuer is wrong.

Use the issuer with the slash at the end and check that Monosign opens from the Headscale server.

Monosign shows a redirect URI error

The callback address does not exactly match the Allowed Redirect URIs.

Use https://<headscale-address>/oidc/callback exactly (step 2).

An error appears after returning from Monosign

Wrong Client Id or Client Secret, or email_verified_required is not false.

Check the values (steps 1 and 4).

A user cannot sign in

The user is not assigned to the application.

Assign the user in step 3.

After completing the configuration on Headscale and Monosign, it is better to test in a new private browser window if the OIDC SSO doesn’t work, because old session cookies may cause errors.

Permanent link