Blazor WASM App 驗證與授權
參考文章
原來之前已寫過了~哈哈
關鍵知識
開發環境
關鍵程式碼 - 註冊 AuthenticationStateProvider
Last updated
Last updated
[...略...]
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");
//## for Authz.
builder.Services.AddSingleton<AuthenticationStateProvider, CustomAuthenticationStateProvider>();
builder.Services.AddAuthorizationCore();
[...略...]
await builder.Build().RunAsync();