feat(core): branded DCR OAuth providers (WorkOS, Auth0, Clerk, Stytch, Descope)#879
Open
harijoe wants to merge 2 commits into
Open
feat(core): branded DCR OAuth providers (WorkOS, Auth0, Clerk, Stytch, Descope)#879harijoe wants to merge 2 commits into
harijoe wants to merge 2 commits into
Conversation
11983ad to
585d101
Compare
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
4862321 to
d0c46c8
Compare
Base automatically changed from
julien/sky-446-generic-custom-provider-abstraction-dcr-compatible
to
main
June 19, 2026 13:37
9b8da36 to
47e5031
Compare
47e5031 to
e1b562b
Compare
e1b562b to
6768374
Compare
gaokevin1
reviewed
Jun 19, 2026
gaokevin1
reviewed
Jun 19, 2026
6768374 to
6df104e
Compare
…ope) with optional audience verification (SKY-447)
338dd01 to
cd3cfe9
Compare
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.
Summary
packages/core.workosProvider,auth0Provider,clerkProvider,stytchProvider,descopeProvider.customProvider(feat(core): customProvider (SKY-446) #878).customProviderdiscovers the IdP's OAuth metadata and verifies JWTs via JWKS.examples/auth-*; all five verified end to end on Alpic.Architecture Notes
audienceis now optional incustomProvider/verify — when omitted, theaudcheck is skipped.audclaim;clerkProviderhas noaudienceoption.audienceso it can't be silently dropped.Relationship to #848 (community Descope example)
This supersedes #848 (@mrunankpawar) — please close #848 in favor of the branded
descopeProviderhere, crediting the contributor.Carried over / improved vs #848:
coffee-data.ts, the view, andhelpers.tsare byte-identical; the README is fuller (122 vs 85 lines).src/auth.ts(hardcoded JWKS URL,aud = ${SERVER_URL}/mcp) is replaced by the discovery-based brandeddescopeProvider.audto[DCR client id, project id], so the audience must be the Project ID (verified working). Added Descope MCP Server auth #848's${SERVER_URL}/mcpdoes not match current Descope tokens.Validation (Alpic + playground)
Beyond the unit tests, every example was deployed to Alpic and driven through the complete OAuth flow in the playground — DCR, IdP sign-in/consent, token verification, and a successful authenticated tool call:
example-workos-1210dbbd.alpic.live✅example-auth0-00afc280.alpic.live✅example-clerk-2480a040.alpic.live✅example-stytch-3c5fa3cc.alpic.live✅example-descope-8cb43574.alpic.live✅Each verified end to end: build-time metadata capture →
/.well-known/oauth-protected-resource200 →401+WWW-Authenticateon an unauthenticated/mcp→ IdP sign-in/consent → tokenaud/issuer verified by the provider → tool call succeeds. Per-IdP setup was validated too (DCR enabled; resource/audience configured; Stytch's self-hosted consent pages + SDK domain allowlist; Descope MCP Server).Greptile Summary
This PR introduces five branded DCR OAuth providers (
workosProvider,auth0Provider,clerkProvider,stytchProvider,descopeProvider) as thin wrappers over an expandedcustomProvider, and refactors the corresponding example apps to use them. It also makesaudienceoptional incustomProvider/verifyto accommodate Clerk tokens, which carry noaudclaim.customProviderafter normalising the issuer URL;clerkProviderexplicitly omitsaudienceto skip theaudcheck;descopeProviderderives the Descope Project ID from the MCP Server URL as the default audience.discoverAuthorizationServernow continues past a valid OIDC document that lacksregistration_endpoint, preferring the document that advertises DCR (handles Clerk's split metadata shape).oauth: await <provider>(…)constructor option.Confidence Score: 4/5
Safe to merge after fixing the Clerk README's phantom CLERK_AUDIENCE env variable; all five providers have been end-to-end validated and the core token verification logic is sound.
The Clerk README instructs users to set CLERK_AUDIENCE in their .env file, but env.ts never reads it and clerkProvider accepts no audience parameter. A user who follows the setup guide sets the variable, sees no errors (it is silently ignored), and is left debugging why audience-based access control has no effect.
examples/auth-clerk/README.md — the .env block includes CLERK_AUDIENCE which is not consumed anywhere in the example code.
Reviews (21): Last reviewed commit: "feat(examples): wire auth examples for t..." | Re-trigger Greptile