Build a Secure TypeScript MCP Client with Cross App Access (XAA)
Cross App Access (XAA) lets an enterprise IdP vouch for a signed-in user across app boundaries, replacing per-app OAuth consent screens and shared service accounts with admin-set policy. The tutorial builds a TypeScript MCP client that signs in via OIDC with PKCE and exchanges the ID token for an ID-JAG (RFC 8693). It then trades the ID-JAG for an access token via the JWT bearer grant (RFC 7523) and calls a protected MCP server, using the MCP SDK's CrossAppAccessProvider against the xaa.dev playground. Key pitfalls: keep separate client credentials for the IdP and the resource authorization server, avoid trailing slashes in audience URLs, and make sure the ID-JAG's resource claim matches the access token's aud.
Related posts
- Implement Secure Cross App Access (XAA) in Go
Okta Developer mediumAdept
Cross App Access (XAA) lets an app or AI agent reach another app's API on a signed-in user's behalf without a second sign-in or consent screen. The enterprise IdP issues a signed Identity Assertion Authorization Grant (ID-JAG) via RFC 8693 token exchange, and the resource's authorization server redeems it through an RFC 7523 JWT bearer grant for a scoped access token. A Go sample app walks the four steps against the xaa.dev playground: OIDC sign-in with hand-built PKCE, state and nonce kept in a short-lived cookie, the two token exchanges, then calling a ToDo MCP server with a bearer-token transport.
- Build "Sign in with Your App" using Supabase Auth
Supabase mediumAdeptSupabase Auth can now act as an OAuth 2.1 and OpenID Connect identity provider, letting a project offer "Sign in with [Your App]" to third-party apps, MCP-based AI agents, partner integrations and enterprise SSO. It uses the authorization code flow with PKCE, issues JWT access tokens carrying a client_id claim alongside the usual user_id and role, and also provides ID tokens, a UserInfo endpoint, refresh tokens, a JWKS endpoint and discovery documents at /.well-known/oauth-authorization-server and /.well-known/openid-configuration. MCP clients can register themselves through dynamic client registration. Existing login methods, Custom Access Token Hooks and Row Level Security all apply to OAuth tokens, so RLS policies can limit each client to specific data by checking the client_id claim. Granular scopes are planned but not yet available.
- Learnings from building our public MCP server
Wealthfront Engineering mediumAdeptWealthfront built a public MCP server so users can connect their cash and investing accounts to AI applications, using Streamable HTTP transport with synchronous calls only, all capabilities exposed as tools with per-tool scope enforcement, and OAuth for authentication. For OAuth client registration they weighed Client ID Metadata Documents, which few agents support, against Dynamic Client Registration (RFC 7591), which carries abuse and DoS hardening scope. They chose user-generated client IDs bound to the creating user, trading setup friction for a faster, safer launch. Testing showed that intent-based tools beat entity-based CRUD-style tools, and that precise parameter and output descriptions prevent agents from misreading fields like an internal accountId.
- Managed Better Auth is now an OAuth provider, with MCP support
Neon mediumAdept
Neon's Managed Better Auth now supports the OAuth Provider plugin, turning an auth instance into an OAuth 2.1 authorization server that both companion apps and MCP clients can use to sign users in. Neon runs the discovery endpoints, JWKS, token issuance and refresh, and client onboarding via Client ID Metadata Documents or optional dynamic registration. You host the login and consent pages and the resource server, where the new @neon/oauth SDK checks token signature, issuer and audience, with adapters for Express, Hono, Next.js and node:http. OAuth configuration is per branch, and each branch gets its own issuer while sharing signing keys, so preview-branch tokens are rejected by production verifiers that pin the issuer.
- Supabase Auth: SSO, Mobile, and Server-side support
Supabase mediumAdeptSupabase Auth adds SAML 2.0 single sign-on, a PKCE authorization flow for server-side rendering and mobile apps, and native Sign in with Apple on iOS. SSO providers are managed with new `supabase sso` CLI commands, and the provider identifier in the JWT can drive Postgres Row Level Security policies for multi-tenant isolation. PKCE replaces the implicit grant flow, which exposed tokens in URL fragments that servers can't read and that malicious mobile apps could intercept. It does this with a hashed code verifier and challenge, so an intercepted authorization code is useless on its own. Enabling it means setting `flowType: 'pkce'` in supabase-js, and a Next.js callback route exchanges the code for a session.