In this repository you can find a sample on how to use authentication inside a Blazor app.
The sample provided uses MSAL library https://learn.microsoft.com/en-us/entra/identity-platform/msal-overview and Azure (Microsoft Entra).
BlazorMsalWithApiSample.API
contains a REST API with a sample controller that requires the client to be authenticated.BlazorMsalWithApiSample.Blazor
contains the Blazor project with authentication.BlazorMsalWithApiSample.Shared
contains simple models.
API must be running in order to access the FetchData page from the Blazor app.
If you are using Visual Studio, it's better to enable multiple startup projects like so:
- The projects were created using
dotnet-8
with Visual Studio 2022 Community Edition - Blazor, Azure and Microsoft Entra logos are property of Microsoft https://www.microsoft.com/