Feature request: PKCE (S256) support for OIDC SSO login

Ouverte
#2,116 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
54/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
typescript
Domaine
api, authentication

Piste de recherche

Start by tracing the API's existing OIDC authorization and callback flow, especially where it stores state and exchanges the authorization code; the issue does not name specific files or tests. Check the bundled openid-client PKCE helpers. Done means authorization requests send an S256 challenge and the matching server-side verifier is included in the token exchange, while the existing login flow still works for providers that do not require PKCE.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Is your feature request related to a problem?

The built-in OIDC SSO login works well, but the Unraid API does not send a PKCE code_challenge in the authorization request. Identity providers that require PKCE for a client therefore reject the login, and PKCE has to be disabled for the Unraid client.

Steps to reproduce

  1. Add an OIDC provider under Settings → Management Access → API → OIDC (issuer, client ID, client secret, scopes, an authorization rule).
  2. In the identity provider, enable "PKCE required" for the Unraid client (tested with Pocket ID v2.19.1: "PKCE" toggle on the OIDC client).
  3. Click the SSO button on the Unraid login page.

Actual result
The authorization request contains response_type, client_id, redirect_uri, scope and state, but no code_challenge / code_challenge_method. The provider returns invalid_request, and /var/log/graphql-api.log shows:

OIDC callback error: Error: Missing required parameters

The user only sees "Authentication failed".

Describe the solution you'd like

The Unraid API generates a code verifier, sends code_challenge with code_challenge_method=S256, and includes the code_verifier in the token request.

  • The OIDC library already bundled with the API (openid-client 6.6.4) has built-in helpers: randomPKCECodeVerifier() and calculatePKCECodeChallenge().
  • Store the verifier server-side together with the existing state, and pass it in the token exchange.
  • Always send PKCE (S256). This is harmless for providers that do not require it. Alternatively, add a per-provider option "Use PKCE (S256)", enabled by default.

Describe alternatives you've considered

  • Disabling "PKCE required" for the Unraid client in the identity provider (works, but weakens the flow).
  • Putting a PKCE-capable reverse-proxy authentication in front of the WebGUI (adds a second login layer and does not fix the native flow).

Additional context

  • OAuth 2.0 Security Best Current Practice (RFC 9700) and the OAuth 2.1 draft recommend PKCE for all clients, including confidential clients, as protection against authorization code injection.
  • More identity providers make PKCE mandatory or recommended by default (Pocket ID, Authentik, Keycloak, Zitadel and others).
  • The Unraid WebGUI gives full control of the server, so it deserves the strongest login flow available.

Thank you for adding OIDC SSO. It is a great feature, and PKCE support would make it complete.

Environment (if relevant)

Unraid OS Version: 7.3.2 (Unraid API 4.37.4+ad268301)

Pre-submission Checklist

  • I have searched existing issues to ensure this feature hasn't already been requested
  • This is not an Unraid Connect related feature (if it is, please submit via the support form instead)
  • I have provided clear examples or use cases for the feature
Langage dominant
TypeScript
Étoiles
123
Forks
25
Merge moyen
2 j 16 h
PR mergées (30 j)
9

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de unraid/api

Toutes les issues de unraid/api

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.