Google OAuth2 “ServiceAccountCredential” does not exist when using ASP.NET Core (RTM)

点点圈 提交于 2019-12-24 17:09:24

问题


I had a ServiceAccount hookup in my .NET Core RC1 app that worked fine. However now, "ServiceAccountCredential" doesn't exist in "Google.APIs.Auth.OAuth2" anymore. The whole library seems to be missing a ton of classes in the RTM version of Core.

Here are the related packages in my project.json

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

I even tried using the RC1 packages, but I keep getting the same thing. Is it simply because Google Auth isn't fully supported in Core yet?


回答1:


The Google API's indeed do not fully support .NET Core yet: https://github.com/google/google-api-dotnet-client/issues/695.

In fact the ServiceAccountCredential is problematic (as I mentioned here) since it calls Windows-specific API's to parse the certificate. It has to be implemented cross-platform first to fully support .NET Core (.NET Standard actually).



来源:https://stackoverflow.com/questions/38591557/google-oauth2-serviceaccountcredential-does-not-exist-when-using-asp-net-core

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!