The required CI suite includes a Vercel Connect fixture for Kernel's hosted OAuth server. It models the Custom OAuth contract documented by Vercel rather than a separate Kernel-specific protocol.
Vercel documents Custom OAuth connectors as follows:
- the connector discovers authorization, token, registration, PKCE, scope, and grant metadata from the provider's server URL;
- Vercel Connect owns client registration, PKCE, state validation, the callback handshake, refresh-token storage, and refresh;
- user authorization uses the authorization-code flow;
- the connector configuration records its exact redirect URI, token-endpoint authentication method, PKCE requirement, challenge method, user scopes, and refresh-token support.
Sources:
- Vercel Connect connectors
- Vercel Connect authentication
- Create a connector API
connectAuthProviderimplementation
The fixture uses a public client (token_endpoint_auth_method=none), authorization code plus refresh grants, openid, and S256 PKCE. Kernel preserves state exactly through its authorization redirect; Vercel Connect owns mismatch detection when handling its callback.
src/app/oauth-conformance/vercel-connect.test.ts verifies:
- OAuth server discovery advertises registration, authorization-code exchange, refresh, and S256 PKCE;
- dynamic registration creates a public client without a secret;
- organization-wide and project-scoped authorization both complete;
- refresh rotation preserves the original organization or project boundary;
- token request fields cannot change the stored organization or scope;
- wrong PKCE verifiers fail before the provider exchange;
- redirect mismatches and invalid public-client authentication fail without persisting token context;
- OAuth state, redirect URI, and PKCE parameters survive the Kernel-to-Clerk redirect unchanged.
CI runs the suite through the repository's required bun test check.
bun test src/app/oauth-conformance/vercel-connect.test.tsThe checked-in redirect uses the reserved .test domain. To replay the same suite with the redirect URI returned by a staging Vercel connector:
VERCEL_CONNECT_REDIRECT_URI='https://<vercel-returned-redirect>' \
bun test src/app/oauth-conformance/vercel-connect.test.tsBefore treating Vercel Connect as a supported consumer:
- Create a staging Custom OAuth connector using Kernel's staging MCP server URL and Vercel Assisted Setup.
- Record the connector response's
redirectUri,tokenEndpointAuthMethod,pkceRequired,codeChallengeMethod, enabled user scopes, and refresh setting. - Compare those non-secret values with the fixture. Run the suite with
VERCEL_CONNECT_REDIRECT_URIset to the returned URI. - Complete organization-wide and project-scoped grants and confirm harmless Kernel reads.
- Refresh each grant and confirm the original scope remains enforced.
Do not commit connector credentials, authorization codes, access tokens, refresh tokens, PKCE verifiers, state, or complete authorization URLs.