Set up single sign-on (SSO)
You can configure your HedgeDoc so users sign in via single sign-on (SSO) against your identity provider. HedgeDoc uses generic OAuth2 with explicit endpoints (no discovery), so it works with Authentik, Keycloak, Zitadel and other OAuth2-capable providers. This guide walks through the setup using Authentik as an example (managed Authentik at server.camp).
The entire configuration is self-service in your server.camp customer portal — no support needed, on all plans. There is no separate enable switch: SSO is active as soon as the required fields are set.
- An active HedgeDoc subscription at server.camp
- A reachable, OAuth2-capable identity provider instance (e.g. managed Authentik at server.camp)
- Admin access to both systems
- In Authentik, open Applications → Providers
- Click “Create” → Type: OAuth2/OpenID Connect
- Fill in the fields:
- Name:
HedgeDoc - Client Type:
Confidential - Redirect URIs:
https://<your-hedgedoc-domain>/auth/oauth2/callback - Signing Key: Select the default key (already available)
- Name:
- Save — Authentik automatically generates a Client ID and Client Secret. You’ll need both later in the portal.
Copy Client ID and Secret nowOpen the provider you just created and copy Client ID and Client Secret into a text editor. You’ll need them shortly in the server.camp portal.
- Go to Applications → Applications → “Create”
- Fill in the fields:
- Name:
HedgeDoc - Slug:
hedgedoc - Provider: select the
HedgeDocprovider you just created
- Name:
- Optional: Under UI Settings, upload a HedgeDoc logo and set the launch URL to
https://<your-hedgedoc-domain> - Save
Restrict access by group (recommended)Open the application → Policy / Group / User Bindings tab → “Create” → Group → select the group that should have access to HedgeDoc (e.g.all-employees). Only members of that group will be able to sign in via Authentik.
HedgeDoc needs the three OAuth2 endpoints explicitly (there is no automatic discovery). You’ll find them in Authentik under the provider or application. They are:
Authorization: https://<your-authentik>/application/o/authorize/
Token: https://<your-authentik>/application/o/token/
Userinfo: https://<your-authentik>/application/o/userinfo/
Replace <your-authentik> with your actual Authentik address. The trailing slashes are part of the URLs.
In the customer portal, open the configuration of your HedgeDoc subscription and enter the following values:
| Field | Value |
|---|---|
| Login button display name | Free to choose, e.g. Sign in with Authentik — shown as the button label |
| Authorization URL | Authorization endpoint from Step 3 |
| Token URL | Token endpoint from Step 3 |
| Userinfo URL | Userinfo endpoint from Step 3 |
| Client ID | Copied from Authentik (Step 1) |
| Client Secret | Copied from Authentik (Step 1) |
| Scopes | Default openid email profile |
Save and wait for the deployment to finish (approx. 1–2 minutes). SSO is active as soon as these required fields are set — there is no separate enable switch. The HedgeDoc login page then shows a button to sign in via your provider.
The following fields have sensible defaults and stay unchanged in most cases. Set them only if your identity provider delivers user data under different claims:
| Field | Default | Effect |
|---|---|---|
| Username claim | preferred_username |
Claim the unique username is read from |
| Display name claim | name |
Claim for the user’s displayed name |
| Email claim | email |
Claim for the user’s email address |
- Open HedgeDoc in the browser
- On the login page, click the button for your provider (e.g. “Sign in with Authentik”)
- Redirect to Authentik, sign in there (and 2FA if enabled)
- Back in HedgeDoc — the user is signed in
Test before rolling outTest the SSO login with a regular user account before rolling it out to the team. This confirms the redirect URI and endpoints are set correctly before everyone relies on it.
- “Redirect URI mismatch” at the IdP: The redirect URI in Authentik doesn’t match what HedgeDoc sends. Verify the URL is stored exactly — including
https://and the path/auth/oauth2/callback. - No SSO button visible: Are all required fields (authorization, token, userinfo URL, client ID, client secret) set in the portal and the deployment finished?
- Sign-in fails or username is missing: Check the scopes (
openid email profile) and whether your provider’s claims match the optional fine-tuning settings (defaultspreferred_username,name,email).
If you run into issues with the SSO integration, reach out at support@server.camp.