Guide

Set up single sign-on with OIDC

Let people sign in to DroppedNeedle through your own OpenID Connect provider, such as Authelia, Keycloak, Authentik or Pocket ID.

Admins only Checked against v3.1.0 Updated Edit this page Report a problem

Liner notes

At a glance

Who
Admins only
Where
Settings › Security
You need
  • An OpenID Connect provider where you can register a client
  • The address people open DroppedNeedle at, ideally https

Single sign-on uses OIDC: people press Continue with SSO, sign in at your provider, and come back signed in to DroppedNeedle. DroppedNeedle’s docs and code give no steps for any one provider, so this guide covers the fields DroppedNeedle asks for.

Before you start#

  • Keep one Admin who signs in with a username and password. If single sign-on breaks, that account still gets in. If it doesn’t, see Get back in after a forgotten password.
  • Work out your redirect URI: the address people open DroppedNeedle at, then your base path if you use one, then /api/v3/auth/oidc/callback. For example https://music.example.com/api/v3/auth/oidc/callback, or https://example.com/music/api/v3/auth/oidc/callback under the base path /music.
  • The provider must use https, unless it runs on the same machine or on your local network. DroppedNeedle’s server talks to the provider directly, so the server has to reach it, not only your browser.
  • Coming from v2? v3 doesn’t answer v2’s /api/v1/auth/oidc/callback. Register the v3 address at your provider: see Upgrading from v2.

Steps#

  1. Register DroppedNeedle at your provider#

    At your provider, create a client for DroppedNeedle and register the redirect URI exactly as you worked it out. Note its client ID, and its client secret if it has one.

  2. Open the single sign-on settings#

    In DroppedNeedle, go to Settings › Security and find the Single Sign-On (OIDC) card.

  3. Enter the issuer URL#

    Fill in Issuer URL with your provider’s base address: the one it lists as issuer in its /.well-known/openid-configuration document. A trailing slash makes no difference. DroppedNeedle doesn’t follow redirects from the provider, so enter its final address.

  4. Enter the client details#

    Fill in Client ID. Fill in Client Secret, or leave it blank for a public client: DroppedNeedle always signs in with PKCE, so a public client works without one.

  5. Enter the redirect URI#

    Fill in Redirect URI with the same address you registered at the provider. It must point at DroppedNeedle’s API (it ends in /api/v3/auth/oidc/callback), not at a page of the web app.

  6. Check the scopes#

    Scopes holds openid email profile by default. Keep openid in it: without it the provider sends no ID token, and every sign-in fails.

  7. Press Test connection#

    Result: the status line reads Connected to and the issuer your provider names. Check that it matches what you entered: a sign-in fails when the two differ.

    The test only fetches the provider’s discovery document. It doesn’t check the client ID, the client secret or the redirect URI, so a passing test doesn’t prove sign-in works. The last step does.

  8. Turn on Allow login with SSO#

    The switch unlocks once Client ID and Redirect URI are filled in and a test has passed. Until then it reads Enter a client ID and redirect URI to enable SSO. or Test the connection first.

  9. Press Save#

    Result: the sign-in page now offers single sign-on.

  10. Try a sign-in#

    Open DroppedNeedle in another browser or a private window, at the same address the redirect URI names. Choose the SSO tab if the page shows tabs, and press Continue with SSO. Sign in at your provider.

    Result: DroppedNeedle shows Completing sign-in… and then opens the app, signed in.

Go straight to SSO

When everyone signs in through your provider, turn on Go straight to SSO in the same card, then press Save. The sign-in page then starts single sign-on by itself instead of showing the sign-in methods. It can only be on while Allow login with SSO is on.

  • /login?local still shows every method, for an admin who can’t use single sign-on.
  • Signing out lands on /login?local, so the provider doesn’t sign you straight back in.
  • A session that runs out sends the browser to the sign-in page, which starts single sign-on again.

What a first sign-in does#

  • Someone who signed in with single sign-on before lands in the same account.
  • Otherwise, when the provider says their email is verified and an account has that email, the sign-in joins that account. To prepare accounts for people, create them with the same emails: see Add people to your server.
  • Otherwise DroppedNeedle makes a new account with the role User. On a server with no accounts yet, the first one is an Admin.
  • A new account’s name comes from the provider’s name, then preferred_username, then nickname, then the part of the email before the @, and otherwise reads OIDC User. Its picture comes from picture or avatar. These are copied once, when the account is made: changes at the provider later don’t reach DroppedNeedle.

“Sign out everywhere” ends DroppedNeedle’s sessions, not your provider’s. A browser that is still signed in at the provider may go straight back in.

If something went wrong#

Each heading below is the message DroppedNeedle shows, or what you see.

OIDC provider URL … uses plain http on a public address. Use https, or keep the provider on this machine or your local network

The issuer URL, or an address in the provider’s discovery document, is plain http on a public address. Switch the provider to https. Plain http only works for a provider on the same machine or on your local network.

Failed to fetch OIDC discovery document.

Test connection couldn’t read /.well-known/openid-configuration under the issuer URL. Check the address, check that DroppedNeedle’s server (not only your browser) can reach the provider, and enter the provider’s final address so no redirect is needed.

Cannot resolve the OIDC provider host in …

DroppedNeedle’s server can’t look up the provider’s host name. Check the name, and that the server’s DNS knows it.

SSO is not configured

The sign-in page shows this when the server refused to start single sign-on: the switch is off, the provider can’t be reached, or its discovery document names a different issuer from the one you entered. The server log names the reason. Compare Issuer URL with the issuer your provider publishes.

After the provider, the browser shows an error with OIDC authentication failed

DroppedNeedle refused the answer that came back from the provider, so the browser shows its short error text instead of the app. The usual causes:

  • The sign-in started at a different address from the one in Redirect URI, for example at http://192.168.1.5:8688 when the redirect URI is on https://music.example.com. The sign-in has to start and end at the same address, so open DroppedNeedle at the redirect URI’s address.
  • The client ID or client secret is wrong. The test doesn’t check them.
  • The sign-in took more than 10 minutes.
Too many attempts. Wait a moment and try again.

Single sign-on is rate limited per browser. Wait a few seconds, then press Continue with SSO again.

Docs