Repository navigation
feat(backend,nextjs): add experimental poppy browser sessions - #10702
thiskevinwang wants to merge 5 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: truePre-merge checks:
|
🦋 Changeset detectedLatest commit: 8dbea17 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-native-components
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
6e672b1 to
0b8dc07
Compare
0b8dc07 to
ac99b0b
Compare
ac99b0b to
12887af
Compare
12887af to
67b7431
Compare
67b7431 to
ebb9b68
Compare
ebb9b68 to
d214318
Compare
d214318 to
170e4c6
Compare
170e4c6 to
7747bb8
Compare
0994619 to
528132a
Compare
| import { PoppyCallback } from '../app-router/client/PoppyCallback'; | ||
| import { decryptClerkRequestData } from './utils'; | ||
|
|
||
| export async function PoppyCallbackPage() { |
There was a problem hiding this comment.
There was a problem hiding this comment.
Update: FAPI interaction, primarily ...
signIn.create({ strategy: 'ticket', ticket })
...needs to happen client side.
60336ae to
0e7b6c4
Compare
0e7b6c4 to
38c6629
Compare
38c6629 to
3c7ff3c
Compare
3c7ff3c to
5342ea4
Compare
|
!snapshot |
|
Hey @thiskevinwang - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/astro@4.1.23-snapshot.v20261112145506 --save-exact
npm i @clerk/backend@3.28.0-snapshot.v20261112145506 --save-exact
npm i @clerk/chrome-extension@3.1.106-snapshot.v20261112145506 --save-exact
npm i @clerk/clerk-js@6.42.4-snapshot.v20261112145506 --save-exact
npm i @clerk/electron@0.1.11-snapshot.v20261112145506 --save-exact
npm i @clerk/electron-passkeys@0.0.4-snapshot.v20261112145506 --save-exact
npm i @clerk/eslint-plugin@0.2.1-snapshot.v20261112145506 --save-exact
npm i @clerk/expo@4.15.2-snapshot.v20261112145506 --save-exact
npm i @clerk/expo-biometrics@1.1.1-snapshot.v20261112145506 --save-exact
npm i @clerk/expo-google-signin@1.1.1-snapshot.v20261112145506 --save-exact
npm i @clerk/expo-native-components@0.4.5-snapshot.v20261112145506 --save-exact
npm i @clerk/expo-passkeys@2.1.8-snapshot.v20261112145506 --save-exact
npm i @clerk/express@2.1.89-snapshot.v20261112145506 --save-exact
npm i @clerk/fastify@3.1.99-snapshot.v20261112145506 --save-exact
npm i @clerk/hono@0.1.99-snapshot.v20261112145506 --save-exact
npm i @clerk/localizations@4.24.7-snapshot.v20261112145506 --save-exact
npm i @clerk/mosaic@0.3.0-snapshot.v20261112145506 --save-exact
npm i @clerk/msw@0.0.87-snapshot.v20261112145506 --save-exact
npm i @clerk/nextjs@7.10.0-snapshot.v20261112145506 --save-exact
npm i @clerk/nuxt@3.1.23-snapshot.v20261112145506 --save-exact
npm i @clerk/react@6.18.7-snapshot.v20261112145506 --save-exact
npm i @clerk/react-router@3.7.1-snapshot.v20261112145506 --save-exact
npm i @clerk/shared@4.44.2-snapshot.v20261112145506 --save-exact
npm i @clerk/swingset@0.0.70-snapshot.v20261112145506 --save-exact
npm i @clerk/tanstack-react-start@1.7.12-snapshot.v20261112145506 --save-exact
npm i @clerk/testing@2.2.56-snapshot.v20261112145506 --save-exact
npm i @clerk/ui@1.42.5-snapshot.v20261112145506 --save-exact
npm i @clerk/upgrade@2.0.12-snapshot.v20261112145506 --save-exact
npm i @clerk/vue@2.5.20-snapshot.v20261112145506 --save-exact |
Description
Important
Experimental Poppy v0.4 support for signed-in browsing with full account access. Clerk hosts the browser session endpoint; the application uses normal Clerk authentication.
Clerk selects the full-account-access browsing profile: Poppy-defined
web.unscoped: truemakespoppy:browser-sign-inauthorize website access with the account's permissions. This fits applications that use Clerk Sessions and do not enforce OAuth scopes on each page.The Poppy-defined browser join uses
GET {J},POST {J}/authorize, andPOST {J}, where{J}is the advertisedweb.browser_session_endpoint. A successful signed-in form POST creates and activates a Clerk Session directly, then returns303to the application with Clerk's existing navigation handshake. The SDK applies the session cookies and reads the normal Clerk Session JWT. No Clerk ticket redemption or customer callback page is required.stateDiagram-v2 direction LR state "Discovery" as Discovery state "OAuth consent" as OAuth state "Poppy browser join" as BrowserJoin state "Clerk Session created" as ClerkSession state "Clerk handshake" as Handshake state "Authenticated application" as Application Discovery --> OAuth OAuth --> BrowserJoin BrowserJoin --> ClerkSession: POST form ClerkSession --> Handshake: 303 to application Handshake --> Application: Session cookiesProposed SDK usage guide — Next.js
Start with the normal Clerk Next.js setup. Enable Poppy for the instance and serve discovery on its configured primary domain.
1. Enable discovery in
proxy.ts, alongside normal Clerk route protection.The SDK serves
/.well-known/poppy.json(Poppy-defined) and/.well-known/oauth-protected-resource(OAuth-defined). Clerk supplies the hosted endpoint URL.2. Read normal Clerk authentication.
userIdandsessionIdidentify the signed-in Clerk user and session. The Clerk-definedagentobject uses the same shape for Poppy and other agent sessions:type: 'agent',subfor the agent identifier, andtask_idwhen a Clerk agent task is associated with the session. Signed-out visitors have no authenticated agent identity.Clerk maps Poppy identification to this common agent shape. Agent-authenticated requests use Clerk's normal Session JWT verification and session lifecycle.
Checklist
Type of change