Skip to content

[Docs] Clarify direct flow execution is not supported for browser SPA sign-in - #3455

Merged
Malith-19 merged 1 commit into
thunder-id:mainfrom
Malith-19:deprecate-native-spa-flows
Jul 3, 2026
Merged

[Docs] Clarify direct flow execution is not supported for browser SPA sign-in#3455
Malith-19 merged 1 commit into
thunder-id:mainfrom
Malith-19:deprecate-native-spa-flows

Conversation

@Malith-19

@Malith-19 Malith-19 commented Jun 22, 2026

Copy link
Copy Markdown
Member

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 via POST /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

  • SDK overview docs (javascript, browser, react, vue): add callouts steering browser SPAs to the redirect-based sign-in flow, and note that continuing a flow with an executionId (as the hosted pages do) and initiating from confidential/server-side code are unaffected.
  • react-vanilla-sample README: add a notice steering browser SPAs to the redirect-based react-sdk-sample.
  • Integration Models guide: scope the App-Native SPA warning and the grant-type note to authentication flows, clarifying that registration, recovery, and user onboarding remain directly initiable via the Flow Execution API regardless of grant type.

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided.
    • Ran Vale and fixed all errors and warnings
  • Tests provided.
    • Unit Tests
    • Integration Tests
  • Breaking changes.
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

  • Documentation
    • Clarified that browser-based SPAs must use the redirect-based OAuth 2.0 authorization code flow with PKCE for sign-in.
    • Added warnings across SDK guides that direct browser sign-in is not supported and may fail at runtime.
    • Explained that continuation requests are still allowed, and registration, recovery, and onboarding flows are not restricted.
    • Updated the React sample README to steer SPA users toward the recommended approach.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Documentation 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 authorization_code + PKCE, and that direct browser sign-in via the Flow Execution API is unsupported.

Changes

Browser SPA sign-in documentation updates

Layer / File(s) Summary
Core authentication model restriction clarification
docs/content/guides/key-concepts/authentication/integration-models.mdx
Scopes the App-Native SPA restriction to authentication flows and describes Flow Execution API rejection behavior for flowType: AUTHENTICATION initiation without executionId when authorization_code is configured.
SDK overview warnings for browser and framework SDKs
docs/content/sdks/browser/overview.mdx, docs/content/sdks/javascript/overview.mdx, docs/content/sdks/react/overview.mdx, docs/content/sdks/vue/overview.mdx
Adds warnings that direct browser sign-in initiation is unsupported and directs SPAs to redirect-based authorization_code + PKCE flows.
Sample README warning
samples/apps/react-vanilla-sample/README.md
Adds a warning that the sample’s direct POST /flow/execute sign-in is unsupported for browser SPAs and points to react-sdk-sample.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related PRs

  • thunder-id/thunderid#2798: Updates the react-vanilla-sample around browser SPA sign-in flow guidance.
  • thunder-id/thunderid#3319: Implements browser-side /flow/execute app-native flow behavior that these docs now explicitly disallow for SPAs.
  • thunder-id/thunderid#3385: Covers the same Flow Execution API restriction for authorization_code apps and authentication-flow initiation.

Suggested reviewers: brionmario, DonOmalVindula, jeradrutnam

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The docs updates align with #3219 by stating browser SPAs must use redirect-based auth and no longer imply direct sign-in is valid.
Out of Scope Changes check ✅ Passed All documented changes stay within the browser-SPA authentication guidance and sample README scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main documentation change and stays concise.
Description check ✅ Passed The description includes Purpose, Approach, Related Issues/PRs, checklist, and security sections, matching the template well.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@Malith-19
Malith-19 force-pushed the deprecate-native-spa-flows branch from ce6a417 to cc8ac5f Compare June 22, 2026 09:06
@Malith-19 Malith-19 changed the title [WIP] Deprecate direct SPA initiation of embedded flows [WIP] Deprecate direct SPA initiation of sign-in flow Jun 22, 2026
@Malith-19
Malith-19 force-pushed the deprecate-native-spa-flows branch 3 times, most recently from 22d22d3 to a9dbe11 Compare June 22, 2026 09:43
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Malith-19
Malith-19 force-pushed the deprecate-native-spa-flows branch from a9dbe11 to 18792bf Compare June 22, 2026 10:10
@Malith-19 Malith-19 changed the title [WIP] Deprecate direct SPA initiation of sign-in flow [WIP] Block direct sign-in flow initiation from browser SPAs Jun 22, 2026
@Malith-19
Malith-19 force-pushed the deprecate-native-spa-flows branch from 18792bf to aee89c5 Compare June 23, 2026 04:15
@Malith-19 Malith-19 changed the title [WIP] Block direct sign-in flow initiation from browser SPAs [WIP] Docs: browser SPAs must use the redirect-based sign-in flow Jun 23, 2026
@Malith-19 Malith-19 added documentation Improvements or additions to documentation skip-changelog Skip generating changelog for a particular PR and removed Type/Improvement labels Jun 23, 2026
@Malith-19 Malith-19 changed the title [WIP] Docs: browser SPAs must use the redirect-based sign-in flow [WIP][Docs] Block direct sign-in flow initiation from browser SPAs Jun 23, 2026
@Malith-19 Malith-19 changed the title [WIP][Docs] Block direct sign-in flow initiation from browser SPAs [Docs] Block direct sign-in flow initiation from browser SPAs Jun 23, 2026
> `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

@ThaminduDilshan ThaminduDilshan Jun 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@darshanasbg @jeradrutnam @brionmario WDYT?

@Malith-19
Malith-19 force-pushed the deprecate-native-spa-flows branch from aee89c5 to b613fdc Compare July 3, 2026 03:12
@Malith-19 Malith-19 changed the title [Docs] Block direct sign-in flow initiation from browser SPAs [Docs] Clarify direct flow execution is not supported for browser SPA sign-in Jul 3, 2026
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
@Malith-19
Malith-19 force-pushed the deprecate-native-spa-flows branch from b613fdc to 258f278 Compare July 3, 2026 03:19
@Malith-19
Malith-19 added this pull request to the merge queue Jul 3, 2026
Merged via the queue into thunder-id:main with commit 8015347 Jul 3, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation skip-changelog Skip generating changelog for a particular PR

Projects

None yet

2 participants