1

我的.NET Core RC1应用程序中有一个ServiceAccount连接可以正常工作。但是,现在“ServiceAccountCredential”不再存在于“Google.APIs.Auth.OAuth2”中。整个库似乎都缺少RTM版Core中的大量类。当使用ASP.NET核心(RTM)时,Google OAuth2“ServiceAccountCredential”不存在

下面是相关的包在我project.json

"Google.Apis.Core": "1.14.0", 
"Google.Apis.Auth": "1.14.0", 
"Google.Apis.Oauth2.v2": "1.14.0.540" 

我甚至使用RC1包试过,但我不断收到同样的事情。是否仅仅因为Google Auth在Core中没有完全支持?

+1

您是否尝试过使用'Microsoft.AspNetCore.Authentication.Google'软件包? https://github.com/aspnet/Security/tree/1.0.0/src/Microsoft.AspNetCore.Authentication.Google来源。 https://docs.asp.net/en/latest/security/authentication/sociallogins.html是facebook的一个例子。谷歌是类似的,但还没有在文档中。从上面检查GitHub存储库 – Tseng

+1

直接链接到示例:P https://github.com/aspnet/Security/blob/1.0.0/samples/SocialSample/Startup.cs#L107-L121 – Tseng

+2

@Tseng即关于身份验证通过谷歌。 OP希望使用Google API来使用服务帐户访问Google服务。 –

回答

3

Google API确实做了而不是完全支持.NET Core:https://github.com/google/google-api-dotnet-client/issues/695

实际上,ServiceAccountCredential存在问题(正如我提到的here),因为它调用Windows特定的API来解析证书。必须首先实现跨平台才能完全支持.NET Core(实际上是.NET标准)。

+0

而这正是我正在寻找的确认。我有一种强烈的感觉,它没有/不被支持。感谢您的链接 - 我现在可以寻找替代品。 – Daath