Skip to content

Add custom OAuth consent security guide#3413

Open
jescalan wants to merge 1 commit into
rob/oauth-consent-docsfrom
je/docs-oauth-custom-consent-page-stack
Open

Add custom OAuth consent security guide#3413
jescalan wants to merge 1 commit into
rob/oauth-consent-docsfrom
je/docs-oauth-custom-consent-page-stack

Conversation

@jescalan
Copy link
Copy Markdown
Contributor

@jescalan jescalan commented Jun 1, 2026

Summary

Stacks on #3315. Adds a security-focused guide for configuring a custom OAuth consent page, with a strong recommendation to use the Account Portal or the prebuilt <OAuthConsent /> component instead of a fully custom flow.

The guide covers consent phishing risk, required consent-screen content, redirect URI presentation, route configuration, safer appearance-based customization, and low-level custom-flow responsibilities.

Changes in this repo

  • Adds Customize the OAuth consent page to the OAuth guide section.
  • Adds tabbed prebuilt <OAuthConsent /> examples for Next.js, React, React Router, TanStack React Start, Astro, Vue, and Nuxt.
  • Adds low-level custom-flow examples for React-based SDKs, with warnings about redirect URI presentation and organization selection.
  • Cross-links the new guide from existing OAuth docs.
  • Updates the OAuth consent component and hook references from Add OAuthConsent and useOAuthConsent docs #3315 to point to the guide and fixes a few snippet accuracy issues.

Preview links

New pages:

Changed sections:

Parent PR

Validation

  • rtk pnpm -C clerk-docs build
  • rtk pnpm -C clerk-docs lint
  • rtk git -C clerk-docs diff --check

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-docs Ready Ready Preview Jun 2, 2026 9:33pm

Request Review

@jescalan jescalan marked this pull request as ready for review June 1, 2026 23:39
@jescalan jescalan requested a review from a team as a code owner June 1, 2026 23:39
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6ae5e884d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/_partials/components/oauth-consent-examples.mdx
Comment thread docs/_partials/components/oauth-consent-custom-flow-examples.mdx
Comment thread docs/_partials/components/oauth-consent-custom-flow-examples.mdx Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7beb713efd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/_partials/components/oauth-consent-custom-flow-examples.mdx Outdated
@jescalan jescalan requested review from jfoshee and wobsoriano June 2, 2026 15:44
Copy link
Copy Markdown
Member

@wobsoriano wobsoriano left a comment

Choose a reason for hiding this comment

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

this looks good on my end 👍🏼

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0bf3843f32

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/reference/components/authentication/oauth-consent.mdx
@jescalan
Copy link
Copy Markdown
Contributor Author

jescalan commented Jun 2, 2026

@coderabbitai review

@jescalan
Copy link
Copy Markdown
Contributor Author

jescalan commented Jun 2, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/_partials/components/oauth-consent-custom-flow-examples.mdx
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love how simple these are. We have a separate issue to investigate alleviating the need for setting the referrer. We will circle back to these docs when we figure that out.

Comment thread docs/guides/configure/auth-strategies/oauth/custom-consent-page.mdx

These examples display the full redirect hostname and an expandable full URL. For a production custom flow, use a public-suffix-aware approach for root-domain summaries, handle IP addresses and localhost explicitly, and test long redirect URIs to make sure the real destination remains visible.

These examples also do not implement organization selection. If an OAuth application can request `user:org:read`, use `<OAuthConsent />` or add an organization selector that submits the selected `organization_id` with the allow action.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How can we remember to update this bit when <OrgSelect /> is made generally available? 🤔

Comment thread docs/guides/configure/auth-strategies/oauth/custom-consent-page.mdx
Comment thread docs/guides/configure/auth-strategies/oauth/custom-consent-page.mdx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants