Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,14 +274,18 @@ AUTH_PROVIDER=oidc
OIDC_AUTHORITY=https://identity.example.com/application/o/krautwatch/
OIDC_CLIENT_ID=…
OIDC_CLIENT_SECRET=… # may be env:/file:
OIDC_REQUIRED_GROUPS=Homelab Admins,Media Admins # optional second check; empty admits anyone
OIDC_REQUIRED_GROUPS=krautwatch-users # optional second check; empty admits anyone
```

Register `https://<host>/signin-oidc` as the redirect URI and request `openid profile email`. Setting
`OIDC_REQUIRED_GROUPS` even though your provider already gates the application is deliberate: two
independent checks mean neither has to be the only thing that is right. Sign-out is federated, and
`/setup` stops asking for an administrator — your provider owns identity.

Group names must match **exactly what your provider emits** in the claim (case aside). The list is
split on commas only, so a name may contain spaces — but plenty of other consumers split on
whitespace too, so hyphenated names travel better between them.

**First run (local provider):** there is no administrator yet, so the `web` host logs a one-time setup link. Fetch it from
the logs and open it:

Expand Down
5 changes: 3 additions & 2 deletions docs/plans/2026-08-23 - oidc authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Auth:Provider = none → AnonymousAccess middleware (unchanged)
"ClientId": "…",
"ClientSecret": "…", // may be a secret reference (env:/file:)
"Scopes": ["openid", "profile", "email"],
"RequiredGroups": ["Homelab Admins", "Media Admins"],
"RequiredGroups": ["homelab-admins", "media-admins"],
"GroupsClaim": "groups"
}
}
Expand All @@ -57,7 +57,8 @@ The homelab's identity blueprint states the principle already: *authenticated mu
authorised*, because the Plex source auto-enrols friends. This adopts it rather than restating it:

1. **Authentik** decides who may obtain a token for Krautwatch at all — application policy bindings
for `Homelab Admins` and `Media Admins`.
for `homelab-admins` and `media-admins` (renamed from the spaced forms by Homelab #497 —
the claim value is what Krautwatch matches, so the two have to stay in step).
2. **Krautwatch** re-checks the `groups` claim against `RequiredGroups` on sign-in, and refuses
otherwise.

Expand Down
7 changes: 6 additions & 1 deletion docs/self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ AUTH_PROVIDER=oidc
OIDC_AUTHORITY=https://identity.example.com/application/o/krautwatch/
OIDC_CLIENT_ID=<from your provider>
OIDC_CLIENT_SECRET=<from your provider> # may be env:/file: like any stored credential
OIDC_REQUIRED_GROUPS=Homelab Admins,Media Admins # optional; empty admits anyone it authenticates
OIDC_REQUIRED_GROUPS=krautwatch-users # optional; empty admits anyone it authenticates
```

The redirect URI to register is **`https://<your-krautwatch-host>/signin-oidc`**, and the sign-out
Expand All @@ -148,6 +148,11 @@ token.** Two independent checks means a policy deleted by a careless change on e
silently open the UI. Leave it empty if your provider has no group model — Krautwatch then admits
whoever completes the flow.

The names must be the ones your provider actually puts in the claim, matched case-insensitively.
Krautwatch splits the list on commas only, so `Some Group,Another` works — but a group name is a
value every consumer re-parses with its own rules, and some split on whitespace as well, so
hyphenated names are the safer convention if anything else reads the same claim.

`/setup` stops asking for an administrator under `oidc`: your provider owns identity and no local
account is ever created. The rest of the wizard — downloads, egress, `*arr` — still applies.

Expand Down
2 changes: 1 addition & 1 deletion src/Domain/Options/OidcOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public sealed class OidcOptions
/// </summary>
/// <remarks>
/// Configuration binds a list from indexed keys (<c>…RequiredGroups__0</c>), which a compose
/// <c>.env</c> has no comfortable way to express. Accepting <c>"Homelab Admins,Media Admins"</c>
/// <c>.env</c> has no comfortable way to express. Accepting <c>"admins,media-users"</c>
/// as well means the setting can be written the way every other one in that file is.
/// </remarks>
public static List<string> ParseGroups(string? commaSeparated) =>
Expand Down
Loading