我正在使用已運行且需要從Core 1.0遷移到Core 2.0並需要在服務身份驗證中使用和遷移字段的代碼。如何在Core 2.0中使用字段? (我在微軟審查遷移文件太多,但不能發現任何東西。)https://docs.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/identity-2xASP.NET Core 1.0升級到ConfigureServices中的ASP.NET Core 2.0升級身份驗證 - 如何在Core 2.0中使用字段?
public void ConfigureServices(IServiceCollection services)
,我遇到了下列麻煩:(怎樣添加在覈2.0以下)
Fields = { "email", "last_name", "first_name" },
下面是我的代碼如下。
ASP.NET 1.0的核心
app.UseFacebookAuthentication(new FacebookOptions
{
AppId = Configuration["Authentication:Test:Facebook:AppId"],
AppSecret = Configuration["Authentication:Test:Facebook:AppSecret"],
Fields = { "email", "last_name", "first_name" },
});
需要遷移到ASP.NET核2.0
services.AddAuthentication().AddFacebook(facebookOptions =>
{
facebookOptions.AppId = Configuration["Authentication:Test:Facebook:AppId"];
facebookOptions.AppSecret = Configuration["Authentication:Test:Facebook:AppSecret"];
});