The previous test built its own AsyncOAuth2Client and passed an explicit
code_verifier, so it asserted Authlib's behaviour rather than RomM's and
passed with or without the fix.
Drive oauth.openid.authorize_redirect (what /api/login/openid calls) and
assert the challenge on the redirect matches the verifier saved to the
session, which is the pair the callback needs to redeem the code.
CLAUDE.md caps a comment at one or two lines and a docstring at one
sentence. The rationale that was inline (the failure mode, the
backwards-compatibility argument, the OAuth 2.1 reference) belongs in the
PR body, so what stays is the one fact the code cannot convey: Authlib
derives no code_verifier unless code_challenge_method is set.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Authlib only derives a code_verifier when `code_challenge_method` is set
on the client, so the OIDC client registered in `decorators/auth.py` sent
no `code_challenge` at all. Against a provider that mandates PKCE the user
authenticates successfully and is then redirected back without a `code`,
which surfaces as a generic login failure with nothing useful in the logs.
Set `code_challenge_method: "S256"` in `client_kwargs`. Providers that do
not support PKCE ignore the extra parameters (OIDC Core 3.1.2.1), so this
is backwards-compatible, and OAuth 2.1 requires PKCE of every client.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>