Overview of Blazor Web App with OIDC, YARP, and Aspire
mainThis sample demonstrates a secure Blazor Web App architecture using the Backend-for-Frontend (BFF) pattern. Key features include:
- Global Auto Interactivity: Uses
PersistingAuthenticationStateProvider(server-side) andPersistentAuthenticationStateProvider(client-side) to synchronize authentication state between server and client. - OIDC Authentication: Implements OpenID Connect (OIDC) with Microsoft Entra using standard OIDC protocols rather than Entra-specific packages.
- Minimal API Backend: A backend that uses
JwtBearerHandlerto validate JWT tokens stored within the Blazor app's sign-in cookie. - BFF Pattern with YARP & Aspire: Uses Aspire for service discovery and YARP (Yet Another Reverse Proxy) to proxy requests (e.g., to
/weatherforecast) to the backend, automatically attaching theaccess_tokenfrom the cookie. - Token Refresh: Implements automatic non-interactive token refresh via a custom
CookieOidcRefresher.