您在哪里可以找到GoogleOAuth2AuthenticationOptions?

时间:2014-05-09 08:50:31

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

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

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

它使用 GoogleOAuth2AuthenticationOptions 对象,我的Google搜索应该位于.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 究竟在哪里呢?哈哈

3 个答案:

答案 0 :(得分:6)

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

答案 1 :(得分:3)

如果您使用的是3.0.0版本的Microsoft.Owin.Security.Google,则必须在Google Developer Console中打开Goog​​le+ 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

答案 2 :(得分:2)

你应该得到Microsoft.Owin.Security.Google。

在Visual Studio中执行以下操作:打开工具 - >库包管理器 - >管理解决方案的NuGet包... 然后在搜索文本框中输入Microsoft.Owin.Security.Google并选择Microsoft.Owin.Security.Google包,按"安装"安装它。

安装" Microsoft.Owin"同样的方式。