Title: OAuth 2.0 authorize/token flow · Issue #160 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: OAuth 2.0 authorize/token flow · Issue #160 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: OAuth 2.0 authorize/token flow · Issue #160 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary Add a shared OAuth 2.0 authorization and token exchange flow to JSS. This is the missing piece that unlocks three ecosystems: Mastodon clients (Elk, Phanpy, Ice Cubes) — need OAuth to complete login after client registration (#15...
Open Graph Description: Summary Add a shared OAuth 2.0 authorization and token exchange flow to JSS. This is the missing piece that unlocks three ecosystems: Mastodon clients (Elk, Phanpy, Ice Cubes) — need OAuth to compl...
X Description: Summary Add a shared OAuth 2.0 authorization and token exchange flow to JSS. This is the missing piece that unlocks three ecosystems: Mastodon clients (Elk, Phanpy, Ice Cubes) — need OAuth to compl...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/160
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"OAuth 2.0 authorize/token flow","articleBody":"## Summary\n\nAdd a shared OAuth 2.0 authorization and token exchange flow to JSS. This is the missing piece that unlocks three ecosystems:\n\n- **Mastodon clients** (Elk, Phanpy, Ice Cubes) — need OAuth to complete login after client registration (#158, landed in #159)\n- **remoteStorage apps** (Litewrite, Groovebasin, 100+ apps) — need OAuth implicit/code flow (#106)\n- **Third-party pane auth** — any losos pane that needs to authenticate external users\n\n## What exists\n\n- **Solid-OIDC** — full DPoP-bound token verification, JWKS caching, replay prevention (`src/auth/solid-oidc.js`)\n- **Client registration** — `POST /api/v1/apps` with in-memory store (`src/ap/routes/mastodon.js`)\n- **Token extraction** — supports DPoP, Bearer, Nostr NIP-98, WebID-TLS (`src/auth/token.js`)\n\nOIDC already provides 90% of the OAuth 2.0 foundation. The gap is small.\n\n## What's needed\n\n### 1. Authorization endpoint — `GET /oauth/authorize`\n\n```\nGET /oauth/authorize\n ?client_id=\u003cregistered_client_id>\n &redirect_uri=https://app.example.com/callback\n &response_type=code\n &scope=read+write\n```\n\nShows consent dialog, redirects with authorization code.\n\n### 2. Token endpoint — `POST /oauth/token`\n\n```\nPOST /oauth/token\n grant_type=authorization_code\n &code=\u003cauth_code>\n &client_id=\u003cclient_id>\n &client_secret=\u003cclient_secret>\n &redirect_uri=https://app.example.com/callback\n```\n\nReturns Bearer token:\n\n```json\n{\n \"access_token\": \"...\",\n \"token_type\": \"Bearer\",\n \"scope\": \"read write\",\n \"created_at\": 1710000000\n}\n```\n\n### 3. Bearer token validation in auth middleware\n\nAdd Bearer token verification to the existing token extraction pipeline in `src/auth/token.js`.\n\n## Consumers\n\n| Consumer | Flow | Scope format |\n|----------|------|-------------|\n| Mastodon clients | Authorization code | `read`, `write`, `follow` |\n| remoteStorage apps | Implicit (token) | `photos:rw`, `documents:r` |\n| losos panes | Authorization code | `read`, `write` |\n\n## Implementation notes\n\n- Reuse existing OIDC session if user is already logged in (no double login)\n- Store tokens with HMAC signature (like existing simple bearer in token.js)\n- Auth skip already established for `/api/v1/*` pattern — add `/oauth/*`\n- Consent dialog can be minimal HTML (no React/framework needed)\n\n## References\n\n- #158 — Mastodon-compatible OAuth + API endpoints\n- #159 — Mastodon API Step 1 (merged)\n- #106 — remoteStorage protocol support (needs OAuth Phase 2)\n- [Mastodon OAuth docs](https://docs.joinmastodon.org/methods/oauth/)\n- [remoteStorage OAuth](https://remotestorage.io/spec/draft-dejong-remotestorage-26#authorization)","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-03-10T04:42:08Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/160"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:39fac395-0f47-e7f5-632f-e6a99959fe1f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AFC:3DE7C3:11B3827:1657F46:6B038EA6 |
| html-safe-nonce | 03e9ebe77a63bb083c512e6b379c054585163332f08d797cbebb41b5bf67602f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUZDOjNERTdDMzoxMUIzODI3OjE2NTdGNDY6NkIwMzhFQTYiLCJ2aXNpdG9yX2lkIjoiMzUwNDQ1NDM2OTEyMDg0OTU3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 61814b86e14a6f0d000c9f3aa2cba5ff8c8d29c449d26ee4f06c6aa2fbf142f4 |
| hovercard-subject-tag | issue:4049356565 |
| 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/160/issue_layout |
| twitter:image | https://opengraph.githubassets.com/619936d4a4ad9779b5be10283adaf15e4c4668e63780010ad9801755fe71d329/JavaScriptSolidServer/JavaScriptSolidServer/issues/160 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/619936d4a4ad9779b5be10283adaf15e4c4668e63780010ad9801755fe71d329/JavaScriptSolidServer/JavaScriptSolidServer/issues/160 |
| og:image:alt | Summary Add a shared OAuth 2.0 authorization and token exchange flow to JSS. This is the missing piece that unlocks three ecosystems: Mastodon clients (Elk, Phanpy, Ice Cubes) — need OAuth to compl... |
| 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 | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width