Deep down in Blazor authentication and authorization
summary
Deep dive into Blazor security shows concrete wiring: Blazor WebAssembly uses IdentityServer4 and the JavaScript OIDC-client.js library, the runtime implements a RemoteAuthenticationService/AuthenticationStateProvider and an AuthorizationMessageHandler to fetch and attach access tokens to HTTP calls. Demo reuses the same components for server and WASM, calls a protected Weather API, and exposes roles via tokens — then fixes a bug where role arrays arrive as a single string by adding a custom ClaimsPrincipal factory. Ends with a permission-based policy library and notes on PWA/offline behavior.
AI-written summary · about
chapters (20)
- 0:00Start
- 0:42Authorization and Authentication
- 4:31Authorized View
- 5:42Authorized Attribute
- 6:04The Authorizer Root View
- 7:50The Authentication State Provider
- 8:57Blazer Server
- 11:02Which Are the Providers That Are Supported than in Blazer Server
- 13:43Adding an Authentication State Provider
- 15:59Identity Server
- 16:25Oidclient Js
- 21:33Redirect Uri
- 25:38Redirect To Login Component
- 26:22Access Token Provider
- 27:57Authorization Message Handler
- 42:20Weather Api
- 52:34Refactoring Permissions
- 53:53Permissions
- 59:00Add Permission Policies
- 1:00:59Authorization Policy Provider
