Document backend proxy guidance for web User API calls#130
Merged
Conversation
Deploying qf-api-docs with
|
| Latest commit: |
d2ef5e9
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://153c6f55.qf-api-docs.pages.dev |
| Branch Preview URL: | https://codex-user-api-origin-clarif.qf-api-docs.pages.dev |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the OAuth2/User APIs documentation to more clearly recommend a backend (or serverless proxy) pattern for web apps: backend-managed token exchange/refresh, server-side session storage, and server-originated User API calls using x-auth-token + x-client-id.
Changes:
- Update the User APIs quickstart to explicitly recommend backend exchange/refresh + backend/proxy User API calls for web apps.
- Adjust the full OAuth2 tutorial to depict the backend as the resource caller for confidential web clients, and expand troubleshooting guidance for browser-origin restrictions.
- Clarify the recommended session + header model in the FAQ and the web integration example.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| docs/tutorials/oidc/user-apis-quickstart.mdx | Adds explicit recommended web-app architecture guidance and clarifies that backend/proxy typically makes the User API call. |
| docs/tutorials/oidc/getting-started-with-oauth2.mdx | Updates the mermaid flow to show backend resource calls and adds origin-policy guidance + troubleshooting notes. |
| docs/tutorials/oidc/example-integration.mdx | Makes the server-side session + outbound header model explicit for the web example. |
| docs/tutorials/faq.mdx | Adds web guidance on session storage and explains the “curl works, browser fails” origin-policy scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The docs already documented the OAuth2 flow and the
x-auth-token/x-client-idheader contract, but they did not make the intended web integration shape explicit enough. A reviewer reading the docs could reasonably infer that once a web app has a valid token, calling User APIs directly from browser JavaScript is the normal path.That is not the recommended pattern for confidential web clients.
Decision
For web integrations, the guidance should be:
httpOnlycookiesx-auth-tokenandx-client-idoutbound to QFSo the docs need to distinguish clearly between:
x-auth-token/x-client-idused when calling QF APIsWhat changed
curl works but browser failscaseImpact
A first-time reader should now understand that:
x-auth-tokenis still the QF API contractValidation
yarn gen-allNotes
yarn typecheckstill fails in this repo because of existing Docusaurus theme alias/type issues unrelated to these MDX edits