Single sign-on (SSO)2.x
infinidysk can sign you in to the UI through one OpenID Connect (OIDC) provider, such as Authentik, Authelia or Keycloak. SSO only covers the UI. WebDAV, the SABnzbd API and the admin API keep their own logins and keys.
Set up SSO
Section titled “Set up SSO”-
Register infinidysk at your identity provider as a confidential client that uses the authorization code flow. Steps for common providers are below.
-
Register this redirect URI at the provider, with your own host name:
https://infinidysk.example.com/auth/oidc/callback -
In infinidysk, open Settings > System > Access > Single sign-on and fill in:
Field What to enter Issuer URL The issuer exactly as the provider publishes it, trailing slash included. Leave empty to turn SSO off. Client ID From the provider. Client secret From the provider. It is masked in the UI, the API and support bundles. Redirect URI Leave empty to use the Public URL plus /auth/oidc/callback. Set it when the provider needs a different address.Scopes Default openid profile email.openidis always sent.Username claim The ID-token claim shown as your username. Default preferred_username. If it is missing, infinidysk triespreferred_username,email, thensub. -
Save, sign out, and use Sign in with SSO on the sign-in page.
Issuer, token and key addresses must use https://. http:// is accepted only for an identity provider on the same machine (localhost or a loopback address). infinidysk does not follow redirects from the identity provider.
Redirect URI behind a reverse proxy
Section titled “Redirect URI behind a reverse proxy”With no Redirect URI and no Public URL, infinidysk builds the redirect URI from the address the request came to. It trusts X-Forwarded-Host and X-Forwarded-Proto only from trusted proxies. Behind a proxy that ends TLS, set the Public URL or list the proxy under trusted proxies. Otherwise the redirect URI may start with http:// and the provider will reject it.
The redirect URI must match the one registered at the provider exactly: scheme, host, port and path. If you open the UI on another address, such as http://192.168.1.10:3000, SSO first sends you to the redirect URI’s host and signs you in there.
Password sign-in
Section titled “Password sign-in”With an admin account, the password form stays on the sign-in page under Sign in with SSO. To allow only SSO, turn Password sign-in off in the same panel.
- The switch shows only when an admin account exists.
- It stays on while SSO is off, and when you set SSO up for the first time.
- You can turn it off only after one SSO sign-in has worked with the saved settings. This keeps a wrong setting from locking you out.
Without an admin account, for example after an upgrade from 1.x that used SSO only, SSO is the only way to sign in and setup does not offer to create an account.
Sessions
Section titled “Sessions”A sign-in lasts 30 days. Signing out ends the infinidysk session only, not the session at your identity provider, so Sign in with SSO may sign you straight back in.
Changing the issuer or client ID signs out every SSO session. Changing other SSO settings keeps sessions, but Password sign-in cannot be turned off until an SSO sign-in works again with the new settings.
Locked out
Section titled “Locked out”If the identity provider is down or the settings are wrong:
- With an admin account: set
INFINIDYSK__AUTH__LOCAL_LOGIN=trueand restart. Sign in with your password, fix SSO, then remove the variable. - Without an admin account: set
INFINIDYSK__AUTH__MODE=localand restart. Open infinidysk from your local network, where sign-in is skipped, fix SSO, then remove the variable.
Clearing INFINIDYSK__AUTH__OIDC__ISSUER also turns SSO off. On an install without an admin account this lets the next visitor create one, so prefer the steps above.
Settings as environment variables
Section titled “Settings as environment variables”Each field can be forced with an environment variable, for example to keep the client secret out of the database:
environment: INFINIDYSK__AUTH__OIDC__ISSUER: https://auth.example.com/application/o/infinidysk/ INFINIDYSK__AUTH__OIDC__CLIENT_ID: infinidysk INFINIDYSK__AUTH__OIDC__CLIENT_SECRET: replace-with-your-client-secretEnvironment variables lists all of them.
Identity provider setup
Section titled “Identity provider setup”Authentik
Section titled “Authentik”- Create an OAuth2/OpenID Provider and an application linked to it.
- Use a confidential client.
- Add the redirect URI as a strict redirect URI.
- Include the
openid,profileandemailscopes. - Bind a group or policy to the application so only admins can use it.
- Use the provider’s OpenID Configuration Issuer as the Issuer URL, for example
https://auth.example.com/application/o/infinidysk/.
Authelia
Section titled “Authelia”- Add infinidysk under
identity_providers.oidc.clientswith a hashed client secret. - Add the redirect URI to
redirect_uris. - Allow the
openid,profileandemailscopes. - Set an
authorization_policythat only admins pass. - Use Authelia’s own address as the Issuer URL, for example
https://auth.example.com.
Keycloak
Section titled “Keycloak”- Create an OpenID Connect client with Client authentication on and Standard flow on.
- Add the redirect URI to Valid redirect URIs.
- Copy the client secret from the client’s Credentials tab.
- Limit access, for example with a realm or client role and an authentication flow that requires it.
- Use the realm issuer as the Issuer URL, for example
https://keycloak.example.com/realms/media.
Troubleshooting
Section titled “Troubleshooting”When SSO fails, the sign-in card shows a short message and the log has a warning, SSO sign-in failed or SSO sign-in could not start, with a reason field. See Logs and traces.
- Redirect URI mismatch at the provider. Compare the Redirect URI field in Settings (its placeholder shows the address used when it is empty) with the one registered at the provider. Set the Public URL or the Redirect URI when infinidysk is behind a proxy.
- Issuer mismatch. The Issuer URL must match the
issuerin the provider’s/.well-known/openid-configuration, including any trailing slash. - Client authentication failed. Check the client secret. infinidysk sends the secret in the request body when the provider lists
client_secret_post, and as HTTP Basic otherwise. - Login expired. A sign-in must finish within 10 minutes. Start again from the sign-in page.
- The wrong username shows. Set Username claim to a string claim your provider puts in the ID token.
After the provider rotates its signing keys, infinidysk picks up the new keys within about a minute.
Upgrading from 1.x
Section titled “Upgrading from 1.x”The upgrade carries SSO over from the 1.x OIDC_* variables. 2.x no longer reads those variables; see Before you upgrade.