突然我的ASP.NET Core 3.1应用程序无法使用Google身份验证
services.AddAuthentication()
.AddGoogle(opts =>
{
opts.ClientId = Configuration.GetSection("GoogleLogin").GetSection("ClientId").Value;
opts.ClientSecret = Configuration.GetSection("GoogleLogin").GetSection("ClientSecret").Value;
opts.Events = new OAuthEvents
{
OnCreatingTicket = context =>
{
var profileUrl = context.User.GetProperty("picture").ToString();
context.Identity.AddClaim(new Claim("picture", profileUrl));
return Task.FromResult(0);
}
};
});