tailscale / tailscale/tsidp

DOCS: Cloudflare Zero Trust OIDC Setup Guide

Open
#70 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation
Dominant language
Go
Stars
669
Forks
61
Avg merge
6d 6h
Merged PRs (30d)
3

Description

Follow up from https://discord.com/channels/1379528469859532931/1405948286090743829/1422317884767604837.

[!WARNING]
I do not claim to be a security expert nor do I claim to be an expert in configuring OIDC.

Therefore, it is the YOUR responsibility to review each step carefully and verify the security of your own OIDC configuration.

Summary

This is an example of how to configure TSIDP to work with Cloudflare Zero Trust.

Prerequisites

You need to have the following already setup and configured.

Prerequisites for Cloudflare

Prerequisites for Tailscale

Prerequisites for tsidp

  • This needs to be running with funnel enabled.

Steps

TSIDP Steps
  • Go to https://idp.<magicdns>.ts.net

  • Click on "Add New Client"

Image
  • Set the following:
    • Client Name: Cloudflare Zero Trust (Can be anything really..)
    • Redirect URLs: https://<team>.cloudflareaccess.com/cdn-cgi/access/callback
    • Click "Create Client"
Image
  • Copy the "Client ID" and "Client Secret" to save for later use.

We are done with tsidp.

Cloudflare Steps
  • Log in to Zero Trust at https://one.dash.cloudflare.com

  • In the left sidebar, scroll down and click on "Settings".

  • While here, click on "Authentication".

Image
  • Scroll down to "Login methods", click on "Add new".
Image
  • Click on "OpenID Connect".
Image
  • Set the following:

    • Name: Tailscale SSO (Can be anything..)
    • App ID: <Use the "Client ID" value here>
    • Client secret: <Use the "Client Secret" value here>
    • Auth URL: https://idp.<magicdns>.ts.net/authorize
    • Token URL: https://idp.<magicdns>.ts.net/token
    • Certificate URL: https://idp.<magicdns>.ts.net/.well-known/jwks.json
    • Proof Key for Code Exchange (PKCE): Leave off
    • Enable SCIM: Leave off
    • Email claim: email
    • OIDC scopes: openid, email, profile
  • Click "Save".

Image Image Image Image

Now on the authentication settings page, you should see "OpenID Connect • Tailscale SSO". Click on "Test".

Image

If everything was successful, you should see a "Your connection works" page.

Image

Final Steps

We are almost finished, we need to do a couple more things.

  • Go to Access > Policies. Click "Add a policy".
Image
  • Set the following

    • Name: Allow OIDC Claims (Can be anything really..)
    • For Add rules, under "Include", depending on your desired setup, you can choose which emails are allowed. In the example below, anyone that authenticates with the email foo@gmail.com or their email address ends in @example.com, they are allowed in.
  • Scroll down, click "Save".

Image Image
  • Go to Settings > Authentication > App Launcher > click on "Manage".
Image
  • Click on "Select existing policies"
Image
  • Select the policy you just created and click "Confirm".
Dashboard Login
  • Go to https://<team>.cloudflareaccess.com, Click "Login".
Image
  • In my account, I have 2 login methods configured. However, this time I want to sign in with Tailscale, so I click on "ODIC • Tailscale SSO".
Image

The OIDC flow with tsidp will occur, afterwards I'll be on the dashboard page where I can see all of my apps.

Done

That concludes this guide. As a follow-up, for each application you want to allow Tailscale SSO login, you'll need to make sure they are using the "Allow OIDC Claims" policy.

Apps and their policies can be viewed and managed under Access > Applications > Click on app name > Configure > Policies.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the issue's Cloudflare Zero Trust OIDC setup guide, including the TSIDP Steps, Cloudflare Steps, Final Steps, and Dashboard Login sections. Locate the repository's documentation entry point and determine where this guide belongs. Done means the guide is added in the appropriate documentation location with its prerequisites, configuration steps, screenshots, and successful-login outcome preserved.

Written by the indexing model from the issue text.

Assessment

Domain
authentication, cloud, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.