如何解决授权错误 错误 400:redirect_uri_mismatch 请求中的重定向 URI,在 .net core3.1 中
我想在 asp.net core 3.1 中使用 OAuth 2.0 但我有问题 我的服务代码:
public object GetOuath()
{
string[] scopes = new string[] {
"https://www.googleapis.com/auth/gmail.settings.basic","https://mail.google.com/"
};
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "693426612910-h0q09satea39jgce8btnag6ftaaoaqjo.apps.googleusercontent.com",ClientSecret = "aWQszaJ291eZth51QLteZ4iu"
},scopes,"user",CancellationToken.None).Result;
在启动中:
services.AddAuthentication()
.AddGoogle(options =>
{
options.ClientId = "693426612910-h0q08satea39jgce8btnag6ftaaoaqjo.apps.googleusercontent.com";
options.ClientSecret = "aWQszaJ298eZth51QLteZ4iu";
});
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。