Repository navigation
Description
Summary
xlogin (and any Solid app using dynamic client registration with token_endpoint_auth_method: "none") can complete the authorization code flow against JSS but cannot exchange the code for tokens — the token endpoint returns 401 invalid_client. This is blocking login across the solid-apps suite (explorer, plaza, timeline, hub-mashlib all hit it).
Reproduced against JSS at HEAD (commit fdc219f, package.json says 0.0.201).
Repro
jss start \
--port 5446 \
--host localhost \
--root /tmp/jss-test/pod-data \
--single-user \
--single-user-password test \
--idp \
--notifications \
--mashlib-module <any solid app entry>
Visit http://localhost:5446/public/ in a browser, click any Solid app's Login button (e.g. xlogin's), enter username/password.
POST /idp/interaction/<id>/login→ 302 (login succeeds)- Browser redirected back to the app with
?code=... - xlogin posts to
/idp/tokenwith the code → 401 invalid_client
Log excerpt
err: invalid_client
stack: InvalidClientAuth: invalid_client
at authenticateClient (oidc-provider/lib/shared/client_auth.js:166:17)
at async setWWWAuthenticateHeader (oidc-provider/lib/shared/client_auth.js:49:11)
at async selectiveBody (oidc-provider/lib/shared/selective_body.js:49:5)
error_description: "client authentication failed"
msg: "oidc-provider grant error"
POST /idp/token statusCode=401 contentLength=77 responseTime=1.74ms
Body length 77 bytes is consistent with the standard public-client payload (grant_type=authorization_code&code=...&redirect_uri=...&client_id=...&code_verifier=...) — no client_secret, which is correct for a none-auth client.
Why this matters
This isn't an xlogin-specific problem. It's the OIDC token endpoint refusing every public client. Public clients are the canonical Solid flow: browser-based apps that dynamically register and authenticate per-session via PKCE alone. If JSS's token endpoint can't honour that, no in-browser Solid app can log in — including:
solid-apps/explorer(logging in to read private containers)solid-apps/plaza(logging in to post)solid-apps/timeline(logging in to post)solid-apps/hub(via the newhub-mashlib.jsdata-browser bundle, just spiked)- Any third-party Solid client using
@inrupt/solid-client-authn-browseror similar
Suspected origin
PR #452 (merged 2026-05-14, included in JSS 0.0.194+) reworked stale-session-cookie + consent-crash recovery. It touched src/idp/provider.js and src/idp/interactions.js. The token endpoint went from working (≤ 0.0.193) to silently rejecting public clients sometime after that merge.
Relevant code paths:
src/idp/provider.js:341—token_endpoint_auth_method: 'none'is inclientDefaults, so dynamically-registered clients SHOULD inheritnone. They're being rejected anyway, so either the default isn't taking effect or oidc-provider's client-auth check is over-strict for thenonepath.src/idp/provider.js:379— there's a CORS branch onclient.tokenEndpointAuthMethod === 'none'that exists, suggesting we knew about this case at some point.
Suggested investigation
- Inspect the dynamically-registered client record in the IdP adapter — confirm
token_endpoint_auth_methodis being persisted asnoneafterPOST /idp/reg. - Trace
authenticateClientinoidc-provider'sclient_auth.js:166— what client metadata is it seeing for these requests? Is it expectingclient_secret_basicorclient_secret_postwhen it should accept thenonepath? - Diff
provider.jsagainst pre-OIDC server_error after account delete + re-create (stale session) #452 — anything in the client-auth or grant-type pipeline that would affect public-client acceptance? - Consider whether
expireSessionCookiesKoaor the stale-session redirect is corrupting state in a way that makes the subsequent/idp/tokenrequest appear to be on a different client.
Workaround
Pin JSS to 0.0.193 in package.json (and npm install) to restore login. This is what jspod / nosdav-server consumers may need to do until the fix lands.
Related
- The
solid-appssuite of in-browser Solid clients all share this dependency. Fixing the token endpoint unblocks all of them at once. - Earlier conversation in the issue tracker about the same observation (search:
invalid_client,regression).
Activity
melvincarvalho commentedon May 20, 2026
Updated diagnosis — not a JSS regression
After follow-up investigation, the root cause is stale xlogin client cache, not a JSS code bug. Closing recommendation: keep open as a tracker for the JSS-side UX improvement (better error message + recovery affordance) but the user-visible "login broken" symptom is fixable by clearing localStorage.
Evidence
Curl-only test passes: registering a fresh public client + posting to
/idp/tokenwith a junk code returnsinvalid_grant(expected), notinvalid_client. Means JSS's token endpoint accepts public clients fine when the registration is current.Code review of PR #452: the 5 commits only touch cookie expiry on account-delete + renderError stale-session recovery. None modify the client adapter or
authenticateClientlookup. The373da9c"gate on GET only" commit ensures POST/idp/tokennever enters the cookie-expiry branch.The actual failure path:
oidc-provider'sauthenticateClientcallsawait Client.find(client_id). If unknown →InvalidClientAuth. xlogin cachesclient_idin localStorage per IdP origin. When JSS restarts with a fresh data dir, the previously-registered client no longer exists in the adapter — but xlogin still tries to use the cachedclient_id. Result: 401 invalid_client.Workaround for end users
Clear localStorage + cookies for the pod IdP origin. xlogin will re-register on the next login attempt.
Fix surface
Two complementary improvements possible:
invalid_clienton/idp/token, drop the cached client_id, re-register, retry. One round trip recovery, transparent to the user.Client.findreturns undefined, distinguishing "client not registered" from "client auth method mismatch". Helps any client library do the same recovery.I'll file (1) on the xlogin repo. (2) can live here if folks want — happy to close otherwise.
Apology for the noise
The original report blamed PR #452 based on circumstantial timing. The bisect / code-review investigation has cleared #452 — that PR fixes a real bug (account-delete + re-create) and doesn't regress this path. Sorry for the misdirection.
melvincarvalho commentedon May 20, 2026
Resolved — not a JSS bug
After thorough investigation across multiple JSS versions (0.0.193 through HEAD/0.0.202), this was operator error on my end, not a regression in JSS:
The repro instance was started with
--single-user-password test, which created the single-user account with that password. I then tried logging in asme / me(matching jspod's convention). Authentication failed silently, the IdP re-rendered the login form, and I misread the symptom asinvalid_clientat/idp/tokenbased on stale browser state from earlier debugging.After provisioning the account fresh with the matching password (
--single-user-password me, wipe.idp/accounts/), login completes cleanly and the full OIDC flow succeeds end-to-end against current HEAD.Real bug from this investigation, worth filing separately: when
interaction.lastErroris set after a failed login, the IdP's login page re-renders identically without surfacing the error to the user. ThelastErroris plumbed intologinPage(uid, params.client_id, interaction.lastError)insrc/idp/interactions.js:30but apparently never rendered visibly. That's the real UX bug that wasted hours of investigation here. I'll file that one separately.PR #452 cleared — it does what it says (recovers from stale session cookies after account delete + re-create) and does not regress public-client login.
Apologies for the noise.
fix(idp): login error survives the redirect — ride in lastSubmission — …