var builder = WebApplication.CreateBuilder(args);
var services = builder.Services;
var configuration = builder.Configuration;
services.AddAuthentication().AddFacebook(facebookOptions =>
{facebookOptions.AppId = "xxxxx";
facebookOptions.AppSecret = "xxxxx";
});
services.AddAuthentication().AddGoogle(googleOptions =>
{ googleOptions.ClientId = configuration["Authentication:Google:ClientId"];
googleOptions.ClientSecret = configuration["Authentication:Google:ClientSecret"];
});`
Facebook运行良好。谷歌有什么问题?我在NuGet上找不到任何软件包。
1条答案
按热度按时间vsnjm48y1#
不要忘记安装
Microsoft.AspNetCore.Authentication.Google
nuget软件包。