如何解决例外:关联失败未知位置异常:处理远程登录时遇到错误
突然我的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);
}
};
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。