[Docs] Clarify direct flow execution is not supported for browser SPA sign-in - #3455
Conversation
📝 WalkthroughWalkthroughDocumentation across the key-concepts guide, browser/JavaScript/React/Vue SDK overviews, and a sample README is updated to state that browser SPAs must use redirect-based OAuth2 ChangesBrowser SPA sign-in documentation updates
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bundle ReportBundle size has no change ✅ |
ce6a417 to
cc8ac5f
Compare
22d22d3 to
a9dbe11
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
a9dbe11 to
18792bf
Compare
18792bf to
aee89c5
Compare
| > `POST /flow/execute` directly from the browser (the "app-native" pattern). Browser single-page | ||
| > applications are **not supported** for direct sign-in initiation and must sign in using the | ||
| > redirect-based OAuth2 `authorization_code` + PKCE flow — see the | ||
| > [`react-sdk-sample`](../react-sdk-sample) for the recommended approach. This sample is kept only |
There was a problem hiding this comment.
Not related to this PR, but related to your effort... IMO we shouldn't provide a sample for a non recommended implementation. Instead we should give a nextJS sample maybe.
aee89c5 to
b613fdc
Compare
Browser SPAs cannot initiate a sign-in flow directly via POST /flow/execute; they must use the redirect-based authorization_code + PKCE flow. Registration and recovery have no redirect equivalent, so SPAs continue to drive those through the Flow Execution API. Per the docs-first alignment in discussion thunder-id#2744, this is guidance only — the SDK does not hard-block or throw. The messaging steers browser SPAs to the redirect-based flow. - Add callouts to the javascript, browser, react and vue SDK overview docs. - Add a notice to the react-vanilla sample steering browser SPAs to the redirect-based react-sdk-sample. - Scope the App-Native SPA warning and grant-type note in the integration models guide to authentication flows, clarifying that registration, recovery, and user onboarding remain directly initiable. Fixes thunder-id#3217 Fixes thunder-id#3219
b613fdc to
258f278
Compare
Purpose
Browser SPAs are public clients that cannot be verified when calling the Flow Execution API directly. The documentation did not make this explicit, and some SDK content presented the embedded (app-native) sign-in pattern as valid for SPAs.
This PR updates the documentation to state clearly that browser SPAs must sign in through the redirect-based OAuth 2.0
authorization_code+ PKCE flow and cannot initiate a sign-in flow directly viaPOST /flow/execute. It also scopes the restriction correctly: it applies to sign-in (authentication) only — registration and recovery have no redirect-based equivalent and continue to run through the Flow Execution API.Per the docs-first alignment in discussion #2744, the SDK is not hard-blocking or removing the embedded flow method (it is legitimately used by confidential/server-side clients and by the hosted pages for continuation). The enforcement is documentation guidance, so the callouts describe the pattern as unsupported for browser SPAs rather than as a runtime error.
Approach
executionId(as the hosted pages do) and initiating from confidential/server-side code are unaffected.react-vanilla-sampleREADME: add a notice steering browser SPAs to the redirect-basedreact-sdk-sample.Related Issues
Related PRs
thunder-id/javascript-sdks.Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit