Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tsidp

> 安全
Open source

A simple OIDC / OAuth Identity Provider (IdP) server for your tailnet.

635 stars0 likes0 views
WebsiteGitHub

About

A simple OIDC / OAuth Identity Provider (IdP) server for your tailnet.

tsidp - Tailscale OpenID Connect (OIDC) Identity Provider

[!CAUTION] This is an experimental update of tsidp. It is under active development and may experience breaking changes. tsidp is an OIDC / OAuth Identity Provider (IdP) server that integrates with your Tailscale network. It allows you to use Tailscale identities for authentication into applications that support OpenID Connect as well as authenticated MCP client / server connections.

Prerequisites

  • A Tailscale network (tailnet) with MagicDNS and HTTPS enabled
  • A Tailscale authentication key from your tailnet
  • (Recommended) Docker installed on your system
  • Ability to set an Application capability grant

Running tsidp

(Recommended) Using the pre-built image

Docker images are automatically published at when releases are tagged.

[!TIP] Replace YOUR_TAILSCALE_AUTHKEY with your Tailscale authentication key in the following commands:

Use an existing auth key or create a new auth key in the Keys page of the Tailscale admin console. Ensure you select an existing tag or create a new one.

Here is an example docker compose YAML file for tsidp:

…

yaml

environment:

  • TS_AUTHKEY=tskey-client-xxxxx
  • TS_ADVERTISE_TAGS=tag:tsidp

[!NOTE] Using Docker Secrets

Passing TS_AUTHKEY as a plain environment variable puts the key in docker inspect output and the container's process environment. To avoid that, mount the key as a Docker secret and point tsidp at the mounted file with TS_AUTHKEY_FILE instead:

services:
  tsidp:
    image: ghcr.io/tailscale/tsidp:latest
    environment:
      - TAILSCALE_USE_WIP_CODE=1
      - TS_STATE_DIR=/data
      - TS_AUTHKEY_FILE=/run/secrets/ts_authkey
    volumes:
      - tsidp-data:/data
    secrets:
      - ts_authkey
secrets:
  ts_authkey:
    file: ./ts_authkey.txt
volumes:
  tsidp-data:

Other Ways to Build and Run

Building your own container

$ make docker-image

Using Go directly

If you'd like to build tsidp and / or run it directly you can do the following:

# Clone the Tailscale repository
$ git clone https://github.com/tailscale/tsidp.git
$ cd tsidp

# run with default values for flags
$ TAILSCALE_USE_WIP_CODE=1 TS_AUTHKEY={YOUR_TAILSCALE_AUTHKEY} TSNET_FORCE_LOGIN=1 go run .

…

hujson
"grants": [
  {
    // Very permissive and suitable only for testing.
    "src": ["*"],
    "dst": ["*"],

    // Example of a grant for tsidp:
    "app": {
      "tailscale.com/cap/tsidp": [
        {
          // allow access to UI
          "allow_admin_ui": true,

          // allow dynamic client registration
          "allow_dcr": true,

          // Secure Token Service (STS) controls
          "users":     ["*"],
          "resources": ["*"],

          // extraClaims are included in the id_token
          // recommend: keep this small and simple
          "extraClaims": {
            "bools": true,
            "strings": "Mon Jan 2 15:04:05 MST 2006",
            "numbers": 180,
            "array1": [1,2,3],
            "array2": ["one", "two", "three"]
          },

          // include extraClaims data in /userinfo response
          "includeInUserInfo": true,
        },
      ],
    },
  },
],

tsidp Configuration Options

The tsidp-server is configured by several command-line flags:

Flag Description Default
-dir Directory path to save tsnet and tsidp state. Recommend to be set. ""
-hostname hostname on tailnet. Will become .your-tailnet.ts.net idp
-port Port to listen on 443
-local-port Listen on localhost:. Useful for testing disabled
-use-local-tailscaled Use local tailscaled instead of tsnet false
-funnel Use Tailscale Funnel to make tsidp available on the public internet so it works with SaaS products disabled
-enable-sts Enable OAuth token exchange using RFC 8693 disabled
-advertise-tags Comma-separated advertise tags (e.g. tag:tsidp). Required when using OAuth client secrets ""
-log Set logging level: debug, info, warn, error info
-debug-all-requests For development. Prints all requests and responses disabled
-debug-tsnet For development. Enables debug level logging with tsnet connection disabled

CLI Environment Variables

The tsidp-server binary is configured through the CLI flags above. However, there are several environment variables that configure the libraries tsidp-server uses to connect to the tailnet.

Required

  • TAILSCALE_USE_WIP_CODE=1: required while tsidp is in development ( [!WARNING]

Serverless/Stateless Deployment: tsidp requires persistent state storage to function properly in production. Without a persistent -dir, the service will re-register with Tailscale on every restart, lose dynamic OIDC client registrations, and invalidate user sessions. Serverless environments without persistent storage are not recommended for production use.

  • TS_AUTHKEY=: Key for registering a tsidp as a new node on your tailnet. Can be a traditional auth key or OAuth client secret (tskey-client-xxx). If omitted, a link will be printed to manually register.
  • TS_AUTHKEY_FILE= / -authkey-file : Same as TS_AUTHKEY, but reads the key from a file - useful when your key comes from a Docker/Kubernetes secret instead of an env var. Don't set this alongside TS_AUTHKEY; tsidp will refuse to start rather than guess which one you meant. If the file is missing, tsidp just logs a warning and carries on (it may already be registered from a previous boot). No effect with -use-local-tailscaled.
  • TS_ADVERTISE_TAGS=: Comma-separated advertise tags (e.g., "tag:tsidp,tag:server"). Optional, but required when using OAuth client secrets.
  • TSNET_FORCE_LOGIN=1: Force re-login of the node. Useful during development.

Docker Environment Variables

The Docker image exposes the CLI flags through environment variables. If omitted the default values for the CLI flags will be used.

[!NOTE] TS_STATE_DIR and TS_HOSTNAME are legacy names. These will be replaced by TSIDP_STATE_DIR and TSIDP_HOSTNAME in the future.

Environment Variable CLI flag
TS_STATE_DIR= *note prefix -dir
TS_HOSTNAME= *note prefix -hostname
TSIDP_PORT= -port
TSIDP_LOCAL_PORT= -local-port
TSIDP_USE_LOCAL_TAILSCALED=1 -use-local-tailscaled
TSIDP_USE_FUNNEL=1 -funnel
TSIDP_ENABLE_STS=1 -enable-sts
TSIDP_LOG= -log
TSIDP_DEBUG_TSNET=1 -debug-tsnet
TSIDP_DEBUG_ALL_REQUESTS=1 -debug-all-requests
TS_AUTHKEY= (env var only)
TS_AUTHKEY_FILE= -authkey-file
TS_ADVERTISE_TAGS= -advertise-tags

Application Configuration Guides (WIP)

tsidp can be used as IdP server for any application that supports custom OIDC providers.

[!IMPORTANT] Note: If you'd like to use tsidp to login to a SaaS application outside of your tailnet rather than a self-hosted app inside of your tailnet, you'll need to run tsidp with --funnel enabled.

  • Proxmox

TODOs

  • (TODO) Grafana
  • (TODO) open-webui
  • (TODO) Jellyfin
  • (TODO) Salesforce
  • (TODO) ...

MCP Configuration Guides

tsidp supports all of the endpoints required & suggested by the MCP Authorization specification, including Dynamic Client Registration (DCR). More information can be found in the following examples:

  • MCP Client / Server
  • MCP Client / Gateway Server

Support

This is an experimental, work in progress, community project. For issues or questions, file issues on the GitHub repository.

License

BSD-3-Clause License. See LICENSE for details.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goidpmcpoauthoauth2

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category安全
PricingOpen source

> Related tools

O
OWASP ZAP
开源 Web 应用安全扫描器
O
owasp-wstg-tracker
Simple web app to track OWASP WSTG security testing progress
H
homebridge-mi-gateway-security
XiaoMi Gateway Security plugin for HomeBridge.