feat: add auth0 service emulator - #89
Conversation
|
@mvanhorn is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
924fcc4 to
7642cc0
Compare
|
@vercel - addressed in f0c26c4. The /u/consent GET route now reads user_ref from the query string and merges it into the hidden form fields passed to renderConsent, so the form post to /u/consent/callback no longer drops the user identity. Added an integration test ( 33/33 auth0 tests pass; type-check and lint clean. |
OIDC discovery and JWKS, OAuth authorize/token/userinfo/logout, and the management API for users, roles, applications, organizations and connections, plus a SKILL.md. Rebuilt on current main: core replaced the real `hono` dependency with its own implementation in `core/src/http.ts`, so `Hono`, `Context` and `ContentfulStatusCode` now come from `@emulators/core` like the other emulators, and the package no longer depends on `hono`.
f0c26c4 to
2b7a121
Compare
|
Rebased onto main -- 2b7a121. Still relevant: no Auth0 emulator on The branch was 72 commits behind and needed more than conflict resolution. 33 tests in |
Summary
Adds an Auth0 service emulator with stateful tenant-aware OIDC discovery, Universal Login pages, PKCE auth code flow, refresh token rotation, client credentials, Userinfo, logout, and a Management API for users, roles, applications, organizations, and connections. Mirrors the existing Okta plugin's structure with Auth0-specific surface differences.
Why this matters
Auth0 is one of the two most-used hosted identity providers in the JS ecosystem. The official
@auth0/nextjs-auth0SDK has ~430K weekly npm downloads;@auth0/auth0-reacthas ~700K weekly. CI tests against Auth0 today either hit production tenants (network-bound, tenant cost, cross-test contamination) or stub at the HTTP level, which loses OIDC flow correctness, refresh token rotation semantics, and per-API audience validation.emulate's
Storeand shared OAuth helpers give us a stateful OIDC provider with the same primitives the Okta plugin uses, plus Auth0's distinct surface (tenants, organizations, connections, audience-scoped APIs).Universal Login
The login page uses the shared
core/src/ui.tsdesign system (terminal green on black, pixel font), so it inherits the same look as the other emulator UIs.Auth0 API Coverage
GET /.well-known/openid-configurationGET /.well-known/jwks.jsonGET /authorizePOST /oauth/tokenGET /userinfoGET /v2/logoutGET /api/v2/users/POSTGET /api/v2/roles/POSTGET /api/v2/applications/POSTGET /api/v2/organizations/POSTGET /api/v2/connections/POSTDistinct from Okta
The two providers share the OIDC layer but diverge on:
<tenant>.auth0.localhost), with a?tenant=<tenant>query-param fallback for callers that cannot route subdomains in CIorganizationsprimitive (org-scoped membership and role assignment)connectionslayer (database, social, enterprise) that Auth0 exposes as a configurable login sourceaudiencevalidation on/authorize, distinct from Okta's authorization-server audiencesSeed config
Default port
4012(appended at the end ofSERVICE_NAME_LISTafterclerk— no other service's port shifts).Tests
32 Vitest tests covering OIDC discovery, JWKS, PKCE flow, refresh token rotation, client_credentials, userinfo, audience validation, logout, and Management API CRUD across users / roles / applications / organizations / connections.