ASP.NET Core implementation of the OAuth 2.0 Token Exchange RFC 8693 standard using Entra ID and Duende IdentityServer.
The solution implements an ASP.NET Core web application which authenticates using Microsoft Entra ID. The web application uses an API protected with a Microsoft Entra ID access token. This API uses another downstream API protected with Duende IdentityServer. The API exchanges the Microsoft Entra ID access token for a new Duende IdentityServer access token using the OAuth 2.0 Token Exchange standard. Both APIs use a user delegated access token. The tokens are persisted on the trusted backend using the IDistributedCache implementation. This can be an in-memory cache or a persistent cache. When using this cache, it is important to automatically renew the access token, if it is missing or invalid.
- ASP.NET Core user delegated access token management
- ASP.NET Core user application access token management
- ASP.NET Core delegated OAuth token exchange access token management
Add-Migration "InitIdentityNew" -c ApplicationDbContext
Update-Database
OAuth 2.0 Token Exchange delegated implementation with Microsoft Entra ID and OpenIddict (RFC 8693)
https://github.com/damienbod/OAuthGrantExchangeOidcDownstreamApi
OAuth 2.0 Token Exchange delegated implementation with Microsoft Entra ID and OpenIddict
- 2025-02-07 Update packages
- 2025-02-01 Initial version
https://github.com/damienbod/OAuthGrantExchangeOidcDownstreamApi
https://docs.duendesoftware.com/identityserver/v7/tokens/extension_grants/token_exchange/
https://datatracker.ietf.org/doc/html/rfc8693
https://www.youtube.com/watch?v=Ue8HKBGkIJY&t=
https://github.com/damienbod/OnBehalfFlowOidcDownstreamApi
https://www.rfc-editor.org/rfc/rfc6749#section-5.2
https://github.com/blowdart/idunno.Authentication/tree/dev/src/idunno.Authentication.Basic
Best Current Practice for OAuth 2.0 Security
The OAuth 2.0 Authorization Framework
OAuth 2.0 Demonstrating Proof of Possession DPoP
OAuth 2.0 JWT-Secured Authorization Request (JAR) RFC 9101
OAuth 2.0 Mutual-TLS Client Authentication and Certificate-Bound Access Tokens
Microsoft identity platform and OAuth 2.0 On-Behalf-Of flow
OAuth 2.0 Token Exchange RFC 8693