Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nich2408/blazormsalwithapisample
https://github.com/nich2408/blazormsalwithapisample
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nich2408/blazormsalwithapisample
- Owner: nich2408
- Created: 2024-05-16T14:07:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-05-16T14:51:42.000Z (6 months ago)
- Last Synced: 2024-05-16T15:35:04.771Z (6 months ago)
- Language: C#
- Size: 199 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![msal](https://github.com/nich2408/BlazorMsalWithApiSample/assets/98348348/e2578c9b-5aea-426e-9b46-178ab9a0874f)
## 🔐☁ Blazor MSAL with API sample
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).
### 📁 Contents
- `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.### 💻 Usage
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:
![image](https://github.com/nich2408/BlazorMsalWithApiSample/assets/98348348/3f9bd6c9-1975-4bdf-8906-56944419ec8f)
![image](https://github.com/nich2408/BlazorMsalWithApiSample/assets/98348348/2a18db8c-a09c-4b2a-b492-e6155d794b2a)
### ❔ Other info
- 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/