Skip to main content

OIDC Login

A plugin for xTIPP that adds sign-in and registration through any OpenID Connect provider, for example Google, Twitch, Discord or Authentik. It only uses the official hook points of xTIPP 1.0.36, so no file of xTIPP is changed, and the plugin survives updates of xTIPP.

The interface of the plugin is in German, like xTIPP itself. This documentation names the German labels as they appear on screen, for example Konfiguration → OIDC-Anbieter.

Security-relevant code
  • The plugin handles logins and creates accounts. The verification of the ID token is a hand-written implementation on top of OpenSSL and has not been audited by a third party. See Security.
  • Test before you rely on it. Try the whole flow with your own providers, with registration on and off, and with an email address that already exists, before you use it on a live site.
  • No warranty. The plugin is provided as it is, and you use it at your own risk. Review the code before you install it, as with any plugin: it runs with full access to xTIPP and its database.

Features​

  • Any number of OIDC providers, managed by administrators on their own admin page: issuer, client ID, client secret, scopes, optional extra authorization parameters, button label, colour and icon, with a live preview.
  • Templates for common providers fill in everything except the client credentials.
  • Login and registration with the authorization code flow, with state and nonce.
  • New accounts are created inactive, exactly like the normal registration of xTIPP. The welcome mail and the notification of the admins are sent as usual, and admins must approve new users.
  • The login buttons appear on the normal login page of xTIPP, below the username/password form.
  • Menu entries in the admin center (Konfiguration → OIDC-Anbieter) and in the profile menu (Verknüpfte Konten).
  • Users connect and disconnect providers on their own page.
  • An email address that already belongs to an xTIPP account is never taken over.
  • A launch URL per provider, for app dashboards like the one of Authentik.
  • A debug mode that logs every step of a login.

How a login works​

  1. The user clicks a button. The plugin loads the discovery document of the provider (cached for 24 hours) and sends the user to the authorization endpoint, with a random state and nonce kept in the session.
  2. The provider redirects to the callback. The plugin checks the session, the provider and the state, then exchanges the code for an ID token (client_secret_post).
  3. The ID token is verified. If it has no email, name, given_name or family_name and the provider has a userinfo_endpoint, the plugin asks that endpoint and fills in the missing claims, including nickname and preferred_username. Discord, for example, sends the email address only there.
  4. Then one of the following happens:
    • The provider account is already connected: the user is logged in. Inactive accounts are refused.
    • The email address belongs to an existing account: the login is refused, with a hint to log in and link the provider under Verknüpfte Konten in the profile menu.
    • Otherwise, if registration is allowed: the user completes nickname and name (as far as xTIPP asks for them), prefilled from the claims and changeable. An inactive account is created together with the connection, and the admins are notified about the new registration.

The default nickname is the nickname claim, then preferred_username, then name, then the part of the email address before the @.