Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shadynagy/b2c-blazor-wasm-31
Secure an ASP.NET Core Blazor WebAssembly hosted app with Azure Active Directory B2C (Without implicit grant).
https://github.com/shadynagy/b2c-blazor-wasm-31
azure azure-b2c b2c blazor blazor-client blazor-client-side blazor-wasm blazor-webassembly implicit microsoft microsoft-azure msal msal-browser msal-library netcore netcore31 netstandard netstandard21 wasm webassembly
Last synced: 30 days ago
JSON representation
Secure an ASP.NET Core Blazor WebAssembly hosted app with Azure Active Directory B2C (Without implicit grant).
- Host: GitHub
- URL: https://github.com/shadynagy/b2c-blazor-wasm-31
- Owner: ShadyNagy
- License: mit
- Created: 2020-10-12T00:15:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-13T11:26:24.000Z (over 4 years ago)
- Last Synced: 2024-12-18T19:19:36.480Z (about 1 month ago)
- Topics: azure, azure-b2c, b2c, blazor, blazor-client, blazor-client-side, blazor-wasm, blazor-webassembly, implicit, microsoft, microsoft-azure, msal, msal-browser, msal-library, netcore, netcore31, netstandard, netstandard21, wasm, webassembly
- Homepage:
- Size: 36.1 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Azure B2C Blazor WASM Working with 3.1
### Secure an ASP.NET Core Blazor WebAssembly hosted app with Azure Active Directory B2C
### Azure B2C not working in Blazor WASM (netstandard2.1) without the implicit grant so that is the solution1- Create the app [Microsoft Documentation](https://docs.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-azure-active-directory-b2c?view=aspnetcore-3.1)
2- Copy file AuthenticationService.js from src folder to your Blazor WASM project (B2CWasm.Client) in wwwroot folder.
3- Change index.html in wwwroot folder from
```html```
to
```html```
4- add this package to server
```xml```
5- in WeatherForecastController
```csharp
...
using Microsoft.Identity.Web.Resource;
...public class WeatherForecastController : ControllerBase
{
...
static readonly string[] scopeRequiredByApi = new string[] { "your scop name" };
...
[HttpGet]
public IEnumerable Get()
{
HttpContext.VerifyUserHasAnyAcceptedScope(scopeRequiredByApi);...
}
}
```