I'm building a Blazor web app using .NET 9 and targeting interactive client render mode (InteractiveWebAssembly) and authenticating with Entra ID (and using Entra ID roles for authorization). My goal is to have a true SPA experience, where UI logic runs in the browser.
However, I've discovered that authentication and authorization features (such as AuthenticationStateProvider, AuthorizeView and integration with MSAL/Entra ID) are not supported out-of-the-box in interactive client mode. The official documentation seems to confirm this, stating that authentication is only supported for interactive server components.
Questions:
- Am I missing something? OR ...
- Is there an official or community-recommended workaround to enable authentication/authorization in interactive client mode?
- Is exposing claims/roles via a server API endpoint and consuming them with
HttpClientin Blazor components considered a best practice for showing/hiding UI elements? - Are there plans for official support for authentication in interactive client mode in future .NET releases?
Any links to up-to-date guides, samples, or discussions would be greatly appreciated.
Thanks for your help!