Title: OIDC token endpoint returns 400 'origin not allowed for client' for CDN-loaded apps · Issue #10 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: OIDC token endpoint returns 400 'origin not allowed for client' for CDN-loaded apps · Issue #10 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: OIDC token endpoint returns 400 'origin not allowed for client' for CDN-loaded apps · Issue #10 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Problem When Mashlib is loaded from CDN (unpkg.com), the Solid-OIDC login flow fails at the token exchange step with: 400 Bad Request origin not allowed for client Root Cause The oidc-provider library validates CORS requests against the ...
Open Graph Description: Problem When Mashlib is loaded from CDN (unpkg.com), the Solid-OIDC login flow fails at the token exchange step with: 400 Bad Request origin not allowed for client Root Cause The oidc-provider libr...
X Description: Problem When Mashlib is loaded from CDN (unpkg.com), the Solid-OIDC login flow fails at the token exchange step with: 400 Bad Request origin not allowed for client Root Cause The oidc-provider libr...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/10
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OIDC token endpoint returns 400 'origin not allowed for client' for CDN-loaded apps","articleBody":"## Problem\n\nWhen Mashlib is loaded from CDN (unpkg.com), the Solid-OIDC login flow fails at the token exchange step with:\n\n```\n400 Bad Request\norigin not allowed for client\n```\n\n## Root Cause\n\nThe `oidc-provider` library validates CORS requests against the client's registered redirect URIs by default. When a web app like Mashlib is loaded from a CDN domain (unpkg.com) but makes token requests to the Solid server (jss:4000), the origin doesn't match.\n\n## Solution\n\nConfigure `clientBasedCORS` in the OIDC provider to allow all origins:\n\n```javascript\nclientBasedCORS: () =\u003e true,\n```\n\nThis is appropriate for Solid servers because:\n- Solid servers are public and should accept requests from any web app\n- Web apps can be hosted anywhere (CDNs, local development, etc.)\n- The Solid ecosystem relies on apps being able to authenticate against any pod\n\n## Affected Files\n\n- `src/idp/provider.js`\n\n## Testing\n\n1. Start JSS with `--mashlib-cdn --idp` flags\n2. Navigate to a protected resource\n3. Click \"Sign In\" in Mashlib\n4. Complete the login flow\n5. Verify token exchange succeeds","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2025-12-29T07:32:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/10/JavaScriptSolidServer/issues/10"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:82e50e36-1216-5ee4-0c58-24d1469ef135 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD12:3D45D4:8BAF403:B4915C1:6976FE00 |
| html-safe-nonce | 15f3df21069a35917469c38061dbda6a45ef1f697e3e780b422266374266cfe0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDEyOjNENDVENDo4QkFGNDAzOkI0OTE1QzE6Njk3NkZFMDAiLCJ2aXNpdG9yX2lkIjoiMTM3MzYwOTkxNDAyNTgzNjAzMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6e29d3fc729868142c9760e1b21cc20b3541018686c6dc841a600e435471d88b |
| hovercard-subject-tag | issue:3766671520 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/10/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98adc4a9553583c587220e852d77156a336a4e4e5a34f07da47f66ad460b76f6/JavaScriptSolidServer/JavaScriptSolidServer/issues/10 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98adc4a9553583c587220e852d77156a336a4e4e5a34f07da47f66ad460b76f6/JavaScriptSolidServer/JavaScriptSolidServer/issues/10 |
| og:image:alt | Problem When Mashlib is loaded from CDN (unpkg.com), the Solid-OIDC login flow fails at the token exchange step with: 400 Bad Request origin not allowed for client Root Cause The oidc-provider libr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 01d198479908d09a841b2febe8eb105a81af2af7d81830960fe0971e1f4adc09 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f752335dbbea672610081196a1998e39aec5e14b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width