Repository navigation
Authentication
By default YT Zero uses no authentication — it assumes a trusted local network, and profiles are just named views. If you expose the app beyond your LAN, or want each member of the household to sign in, the primary profile can switch the login method under Settings → Authentication.
The Authentication tab is owner-only: only the primary profile (the first profile created) can change login configuration or administrator roles. Delegated and OIDC group administrators can manage ordinary admin-only settings, but cannot change the primary profile or its credentials. See Profiles for what "primary" means.
| Method | Login | Profile switching | Best for |
|---|---|---|---|
| None | none | free | Trusted local network (default) |
| Shared login + profiles | one household login | free, after sign-in | A shared device, Netflix/Plex style |
| Login per profile | per profile | requires re-login | Separate accounts per person |
| OIDC | external provider | depends on mode | SSO with Pocket ID, Authentik, Keycloak, … |
| Proxy header | reverse proxy | requires re-login | Authelia / forward-auth setups |
Public sharing is an explicit exception to these login methods. When enabled,
/share/* uses bearer links instead of a profile session. If an external
forward-auth layer protects the host, it needs a narrow path exception without
making /api/* public. Read Public Sharing before configuring
that exception.
When any method other than None is active, the per-profile 6-digit PINs are not used — the login replaces them. The Child Lock settings PIN is separate and keeps working.
The Authentication tab is a three-step wizard:
- Choose a method — pick one of the cards. The currently active method is marked.
- Configure — fill in the credentials / provider details for the selected method. Use Save to store them without switching yet.
- Activate — apply the method. The app reloads and the new login takes effect immediately.
The wizard refuses to activate a method until its prerequisites are met (for example, a shared password or passkey must exist before activating Shared), so you cannot accidentally lock yourself out in one click. If you still do, see Recovery.
Exactly one method is active at a time, and there is no fallback between methods. Whatever you activate is the only way in — if it stops working (OIDC provider unreachable, proxy header no longer arriving, forgotten shared/per-profile credentials, a lost passkey), the app does not silently fall back to None or to any previously configured method. You are locked out until you recover. The only way back in is the environment-variable escape hatch below: set it, restart, fix the configuration in Settings → Authentication, then remove it and restart. Plan for this before exposing the app publicly.
No login. Anyone who can reach the app picks a profile, exactly as before. This is the default.
One household login guards the app; once signed in, you can switch freely between all profiles (like choosing a profile on a shared streaming account).
- Select Shared login + profiles.
- Set a password (and optionally a username).
- Optionally click Add passkey to register a passkey for password-less sign-in.
- Activate.
After activation everyone signs in with the shared credentials, then uses the profile menu to switch profiles without signing in again.
Each profile has its own credentials. Switching profile means signing out and signing back in as the other profile.
- Select Login per profile.
- Generate credentials for the primary profile and save the one-time temporary password.
- Generate credentials separately for every other profile that needs to sign in.
- Activate.
Usernames are derived from profile names: spaces become _, unsupported
characters are removed, and case-insensitive collisions receive a numeric
suffix. Generating credentials again immediately invalidates the previous
password. Temporary passwords are shown once and stored only as hashes.
After signing in, a profile changes only its own password under Settings → Profiles and must provide the current password. A newly created profile receives one-time temporary credentials in the creation result while this login method is active. Passkeys can be added by each profile from its own session.
In the profile menu, choosing a different profile prompts you to sign out first.
Sign in through an external OpenID Connect provider such as Pocket ID, Authentik, Keycloak, or Authelia (OIDC).
- Select OIDC and fill in:
-
Issuer URL — the provider's full issuer. Pocket ID and Keycloak usually use the root or a realm URL (
https://id.example.com), while Authentik uses a per-application path with a trailing slash:https://id.example.com/application/o/<slug>/. If discovery returns 404, the issuer is wrong — copy the "OpenID Configuration Issuer" from your provider and use Test connection to verify. - Client ID and Client secret
-
Scopes — defaults to
openid profile email -
Redirect URI — shown read-only; copy it into your provider's allowed redirect URIs. It is
<your app URL>/api/auth/oidc/callback. SetAPP_URLif the app is behind a reverse proxy so this URL is correct.
-
Issuer URL — the provider's full issuer. Pocket ID and Keycloak usually use the root or a realm URL (
- Click Test connection to verify the issuer's discovery document is reachable.
- Choose a mapping mode (below).
- Activate.
-
Identity → one profile (mapped) — each external identity maps to exactly one profile. Profile switching is disabled (you sign out to change profile). Choose the identity claim (default
preferred_username) and, in the profile table, enter the claim value that maps to each profile. Optionally enable auto-create a profile on first login to create a profile automatically for unknown identities. - Gateway → profile picker — OIDC only guards the front door. After signing in, everyone sees the profile picker and can switch freely (similar to Shared).
For active profile-bound methods (Login per profile, OIDC, and Proxy header), an administrator can hide other profile names from the profile picker. The signed-in profile remains visible, and administrators can still manage every profile in Settings. This instance-local authentication preference is not included in portable backups.
While a profile-bound login is active (Login per profile, OIDC mapped mode, or Proxy header), the primary profile can grant administrator access to another non-child profile in Settings → Profiles. Delegated administrators can manage shared settings, other non-primary profiles, and child restrictions. They cannot:
- grant or revoke administrator access,
- edit, delete, or demote the primary profile,
- change the primary profile's credentials,
- open or change Authentication settings.
The grant is checked on every request, so revoking it takes effect immediately. It is instance-local security policy and is excluded from portable backups. Delegation is unavailable for None, Shared, and OIDC Gateway because those methods do not securely bind the current request to one profile.
Set an optional Logout URL to send users to your provider's logout endpoint when they sign out.
By default only the primary profile has admin powers. With OIDC you can additionally grant ordinary administrator powers to identities based on a group claim from your provider:
-
Groups claim — the claim in the ID token / userinfo that lists the user's groups (default
groups). - Admin group — the group name that grants admin. Leave it empty to disable group-based admin entirely. When set, any signed-in identity whose groups claim contains this value can manage admin-only app settings and non-primary profiles.
This works in both mapping modes. Group administrators cannot change authentication configuration, administrator grants, or the primary profile. The primary profile always keeps owner powers regardless of groups, so local recovery still works.
-
unsupported operationin the logs after a successful token exchange — the provider signed the ID token with HS256 (HMAC), which isn't accepted. In Authentik this happens when the provider has no Signing Key selected; set it to an RSA/EC certificate (e.g. "authentik Self-signed Certificate") so the ID token uses RS256. -
404on/.well-known/openid-configuration— wrong Issuer URL; for Authentik usehttps://<host>/application/o/<slug>/(trailing slash). -
"Invalid redirect URI" — add the wizard's Redirect URI verbatim to the provider, and set
APP_URLto your publichttps://URL so the callback isn't generated ashttp://. -
no profile mapped to this identity(mapped mode) — the identity claim value doesn't match any profile's mapped value; fix the claim or the mapping, or enable auto-create.
A trusted reverse proxy (e.g. Authelia with forward-auth) authenticates the user and passes their username in a request header. YT Zero matches that value to a profile.
- Select Proxy header.
- Set the header name your proxy sends (e.g.
Remote-User,X-authentik-username). The name is configurable — nothing is hard-coded. - The page shows the currently received value of that header so you can confirm your proxy is sending it.
- In the profile table, enter the header value that maps to each profile.
- Optionally set a logout / redirect URL (e.g. your Authelia logout endpoint).
- Activate.
Profile switching is disabled internally — the profile menu offers a sign-out that redirects to the configured logout URL.
Important: only enable this behind a proxy that always sets the header and strips any client-supplied copy. Without a trusted proxy, anyone could send the header themselves.
Passkeys (WebAuthn) are supported for the Shared and Login per profile methods, alongside or instead of passwords.
- The WebAuthn Relying Party ID and origin are derived from the request host. Behind a reverse proxy, set
APP_URL(andWEBAUTHN_RP_IDif needed) so registration and login validate against the correct domain. - Passkeys require a secure context (HTTPS, or
localhost).
Because there is no fallback between methods (see the note above), a broken or forgotten login means you are locked out — the app will not revert to None on its own. The single recovery path is the YTZERO_AUTH_DISABLE environment variable, which requires access to the deployment (Docker Compose file, systemd unit, shell, etc.).
Step by step:
-
Set the variable in the environment and restart the container/process:
YTZERO_AUTH_DISABLE=1This forces the None method for as long as the variable is set, regardless of the saved setting. Nothing in the database is changed — the saved method is only overridden at runtime.
-
Sign in as the primary profile (or any profile — None has no login) and open Settings → Authentication.
-
Correct the configuration — fix the OIDC issuer, re-enter credentials, adjust the proxy header, re-add a passkey, or switch to a different method. Save/Activate as needed.
-
Remove
YTZERO_AUTH_DISABLE(or set it to anything other than1) and restart again so the saved method takes effect.
Keep the ability to edit environment variables and restart the deployment available to whoever administers YT Zero — it is the only way back in. If you run behind a reverse proxy that itself enforces auth, make sure that layer can't also permanently block the recovery login.
See YTZERO_AUTH_DISABLE in the configuration reference.
YT Zero · Deploy · Self-hosted video subscriptions reader · Licensed under AGPL-3.0-only
Getting started
Using the app
- Settings
- Features
- Importing from Google Takeout
- Importing Subscriptions
- Profiles
- Authentication
- Public Sharing
- Child Lock
- Browser Extensions
- YT-DLP Integration
- TubeArchivist Integration
Operations
Project