Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cradle77/Blazor.Msal
Sample implementation for MSAL in Blazor
https://github.com/cradle77/Blazor.Msal
Last synced: 19 days ago
JSON representation
Sample implementation for MSAL in Blazor
- Host: GitHub
- URL: https://github.com/cradle77/Blazor.Msal
- Owner: cradle77
- License: mit
- Created: 2019-11-09T11:53:56.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-08T15:56:12.000Z (almost 5 years ago)
- Last Synced: 2024-08-01T15:03:51.190Z (4 months ago)
- Language: C#
- Size: 418 KB
- Stars: 34
- Watchers: 6
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Des.Blazor.Authorization.Msal
[![Build Status](https://des.visualstudio.com/Blazor.Msal/_apis/build/status/Blazor.Msal-CI?branchName=master)](https://des.visualstudio.com/Blazor.Msal/_build/latest?definitionId=48&branchName=master)
![Nuget (with prereleases)](https://img.shields.io/nuget/vpre/Des.Blazor.Authorization.Msal)
> _.NET Core 3.1 Preview 3 supported_
This NuGet package adds support to Azure Active Directory to your Blazor Web Assembly application. It allows to authenticate the user and then acquire an access token to make a secure call to an external API:
![Diagram](https://github.com/cradle77/Blazor.Msal/blob/master/Diagram.png?raw=true)
The code internally uses [MSAL.js](https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-overview) to implement the *OpenID Connect* and *OAuth2* flows.
I'll be publishing a few articles on this topic. [*Follow me on twitter*](https://twitter.com/crad77?lang=en) if you are interested and want to be notified when they are out.
## How to use the package
### 1. Add the required references
The first step is to reference the NuGet package on the *Blazor Client* project:
```
Install-Package Des.Blazor.Authorization.Msal
```Then we need to include MSAL.js in *index.html* page, before the reference to blazor.webassembly.js. This could either be a static file we include to our project, or just a link pointing to a CDN URL:
```
...