【问题标题】:Where do you find GoogleOAuth2AuthenticationOptions?您在哪里可以找到 GoogleOAuth2AuthenticationOptions?
【发布时间】:2014-06-26 22:36:18
【问题描述】:

我觉得我错过了一些非常基本的东西,但我已经努力解决它。

基本上我想在这里遵循这个问题的答案:https://stackoverflow.com/a/22694372/768952

它使用 GoogleOAuth2AuthenticationOptions 对象,根据我的谷歌搜索,该对象应该位于 .net4.5 框架内:Microsoft.Owin.Security.Google.GoogleOAuth2AuthenticationOptions

但是我的 MVC 项目是 .net 4.5 并且它不存在!尽管如此,它应该是:http://www.symbolsource.org/Public/Metadata/NuGet/Project/Microsoft.Owin.Security.Google/2.1.0-rc1/Release/.NETFramework,Version%3Dv4.5/Microsoft.Owin.Security.Google/Microsoft.Owin.Security.Google/GoogleOAuth2AuthenticationHandler.cs?ImageName=Microsoft.Owin.Security.Google

那么 GoogleOAuth2AuthenticationOptions 到底在哪里?哈哈

【问题讨论】:

  • 只是 GoogleOAuth2AuthenticationOptions 不存在还是命名空间 Microsoft.Owin.Security.Google 也不存在?
  • 所以我假设您已经添加了对 Microsoft.Owin.Security.Google.dll 的引用?
  • 是的,对象不在命名空间内,程序集被引用,如果我对象浏览程序集,对象不在那里。
  • 您引用了哪个版本的 Microsoft.Owin.Security.Google.dll?

标签: c# asp.net-mvc oauth-2.0


【解决方案1】:

您应该获得 Microsoft.Owin.Security.Google。

在 Visual Studio 中执行以下操作:打开 Tools -> Library Package Manager -> Manage NuGet Packages for Solution ... 然后在搜索文本框中输入 Microsoft.Owin.Security.Google 并选择 Microsoft .Owin.Security.Google 包,点击“安装”即可安装。

以同样的方式安装“Microsoft.Owin”。

【讨论】:

    【解决方案2】:

    解决方案就像在 Nuget 中更新 Microsoft.Owin.Security.Google 的版本一样简单。

    【讨论】:

      【解决方案3】:

      如果您使用的是 3.0.0 版本的 Microsoft.Owin.Security.Google,则必须在 Google Developer Console 中开启 Google+ API。 (http://blogs.msdn.com/b/webdev/archive/2014/07/02/changes-to-google-oauth-2-0-and-updates-in-google-middleware-for-3-0-0-rc-release.aspx)

      【讨论】:

        猜你喜欢
        • 2012-11-30
        • 2011-08-22
        • 2014-12-14
        • 2012-05-04
        • 2014-01-17
        • 2011-11-13
        • 2014-11-01
        • 2011-03-31
        • 2013-07-01
        相关资源
        最近更新 更多