谷歌身份验证 - 。核心 - oauth状态丢失或无效
答
//For google client....
using (var stream = new FileStream("client_secrets.json", FileMode.Open, FileAccess.Read))
{
credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(
GoogleClientSecrets.Load(stream).Secrets,
new[] { BooksService.Scope.Books },
"user", CancellationToken.None, new FileDataStore("Books.ListMyLibrary"));
}
// Create the service.
var service = new BooksService(new BaseClientService.Initializer()
{
HttpClientInitializer = credential,
ApplicationName = "Books API Sample",
});
var bookshelves = await service.Mylibrary.Bookshelves.List().ExecuteAsync();
...
}
Thats the example of how you can create google client and service to make google authentication
+0
如果您有任何问题#amethianil ..评论我 –
+0
我已经创建了Google身份验证部分,请在这里查看我的startup.cs类设置 - http://*.com/questions/43607514/google-authentication-exception-no-authentication -handler-is-configured-to-hand 当它从google重定向,然后显示这个错误 - oauth状态丢失或无效 我已经在.net中执行了它的工作正常,但在.net核心不工作 – amethianil
如何地狱是我们应该知道,当你有代码0的例子吗? – ThePerplexedOne
提供有关何时发生问题的更多信息,并最终提供一些代码。 –
请参阅我的应用程序startup- http://*.com/questions/43607514/google-authentication-exception-no-authentication-handler-is-configured-to-hand – amethianil