[英]Blazor WebAssembly App with Individual Accounts and ASP.NET Core Hosted - Disable user registration
[英]Blazor WebAssembly App with Individual User Accounts and Store user accounts in-app using gives no local user accounts
使用Visual Studio 2019 16.8.2
和.NET 5.0
創建具有Individual User Accounts
和Store user accounts in-app
的新Blazor WebAssembly App
不會提供本地用戶帳戶。
啟動應用程序它說:
在驗證 function 正確之前,您必須在 Program.cs 中配置您的提供程序詳細信息
程序.cs:
public class Program
{
public static async Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
builder.Services.AddOidcAuthentication(options =>
{
// Configure your authentication provider options here.
// For more information, see https://aka.ms/blazor-standalone-auth
builder.Configuration.Bind("Local", options.ProviderOptions);
});
await builder.Build().RunAsync();
}
}
單擊登錄重定向到:
https://localhost:44444/authentication/login-failed
帶有以下消息:
嘗試登錄時出錯:“無效的響應內容類型:文本/html,來自 URL:https:login.microsoftonline.com/.well-known/openid-configuration”
wwwroot
-> appsettings.json
看起來像這樣:
{
"Local": {
"Authority": "https://login.microsoftonline.com/",
"ClientId": "33333333-3333-3333-33333333333333333"
}
}
https://aka.ms/blazor-standalone-auth導致https://docs.microsoft.com/en-gb/aspnet/core/blazor/security/webassembly/?view=aspnetcore-3.1
獨立的 Blazor WebAssembly 應用程序似乎需要Azure Active Directory (AAD)
, Azure Active Directory B2C (AAD B2C)
或另一個Identity Provider (IP)
使用Individual User Accounts
創建另一個應用程序並Store user accounts in-app
會提供ASP.NET Core Identity
標識用戶和他們自己的數據庫。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.