# Build a Secure C# MCP App with Cross App Access (XAA)

DevFeed: [Build a Secure C# MCP App with Cross App Access (XAA)](<https://devfeed.tech/articles/build-a-secure-c-mcp-app-with-cross-app-access-xaa-133751.md>)

Original publisher: [Read original article](<https://developer.okta.com/blog/2026/07/16/csharp-mcp-cross-app-access/>)

Author: Aasawari Sahasrabuddhe

Published: 2026-07-16T00:00:00Z

Content type: tutorial

Language: en

Sources: [Okta Developer](<https://devfeed.tech/sources/okta-developer.md>)

Topics: [cross-app-access](<https://devfeed.tech/topics/cross-app-access.md>), [AI Bots](<https://devfeed.tech/topics/ai-bots.md>), [Single sign-on (SSO)](<https://devfeed.tech/topics/sso.md>), [Secure token management](<https://devfeed.tech/topics/secure-token-management.md>)

Tags: [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [api](<https://devfeed.tech/tags/api.md>), [asp-net](<https://devfeed.tech/tags/asp-net.md>), [asp-net-core](<https://devfeed.tech/tags/asp-net-core.md>), [authentication](<https://devfeed.tech/tags/authentication.md>), [authorization](<https://devfeed.tech/tags/authorization.md>), [bearer](<https://devfeed.tech/tags/bearer.md>), [bearer-token](<https://devfeed.tech/tags/bearer-token.md>), [building](<https://devfeed.tech/tags/building.md>), [c-sharp](<https://devfeed.tech/tags/c-sharp.md>), [client](<https://devfeed.tech/tags/client.md>), [cross-app-access](<https://devfeed.tech/tags/cross-app-access.md>), [csharp](<https://devfeed.tech/tags/csharp.md>), [exchange](<https://devfeed.tech/tags/exchange.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [mcp](<https://devfeed.tech/tags/mcp.md>), [net](<https://devfeed.tech/tags/net.md>), [oauth](<https://devfeed.tech/tags/oauth.md>), [oidc](<https://devfeed.tech/tags/oidc.md>), [token-exchange](<https://devfeed.tech/tags/token-exchange.md>), [xaa](<https://devfeed.tech/tags/xaa.md>)

## AI overview

Cross App Access (XAA) lets a C# app use a signed identity assertion to obtain scoped access to an MCP server on a user's behalf, without another login. The article describes two exchanges: RFC 8693 exchanges the user's OIDC ID token for a short-lived JWT Authorization Grant at the enterprise identity provider; RFC 7523 exchanges that grant at the MCP authorization server for a scoped access token. The C# MCP SDK's `IdentityAssertionGrantProvider` wraps both exchanges. The example configures ASP.NET Core OIDC with PKCE, passes the session ID token through `IdTokenCallback`, and uses the resulting bearer token with `HttpClientTransport` to initialize an MCP client and read resources. For testing, register the requester app and ToDo MCP resource at xaa.dev, configure the supplied client credentials and endpoints, then run the sample locally. The excerpt presents xaa.dev as a ready-made test environment.

## Source excerpt

Learn how to build a secure C# MCP client using Cross App Access (XAA) and token exchange so AI agents can securely act on behalf of users.