5

I feel like I am missing something pretty basic however I have had a solid effort at resolving it.

Basically I am trying to follow this question's answer here: https://stackoverflow.com/a/22694372/768952

It makes use of a GoogleOAuth2AuthenticationOptions object, which from my Googling should be located here within the .net4.5 framework: Microsoft.Owin.Security.Google.GoogleOAuth2AuthenticationOptions

However my MVC project is .net 4.5 and it's not there! Despite this saying it should be: 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

So where on earth is GoogleOAuth2AuthenticationOptions? haha

Community
  • 1
  • 1
Xavier Hutchinson
  • 2,207
  • 1
  • 17
  • 21
  • Is it just GoogleOAuth2AuthenticationOptions which is not there or is the namespace Microsoft.Owin.Security.Google also not there? – CathalMF May 09 '14 at 09:01
  • 1
    So I assume you have added a reference to Microsoft.Owin.Security.Google.dll? – CathalMF May 09 '14 at 09:03
  • Yes the object is not within the namespace, the assembly is referenced and if i Object Browse the assembly, the object is not in there. – Xavier Hutchinson May 09 '14 at 09:04
  • 2
    What version of the Microsoft.Owin.Security.Google.dll have you referenced? – CathalMF May 09 '14 at 09:07
  • Microsoft.Owin.Security.Google - v4.0.30319 – Xavier Hutchinson May 09 '14 at 09:11
  • That's the framework version not the file version. But anyway according to MSDN there is no such class. So i think that stack overflow answer is wrong. http://msdn.microsoft.com/en-us/library/microsoft.owin.security.google(v=vs.113).aspx – CathalMF May 09 '14 at 09:18
  • 2
    Try v2.1.0 https://katanaproject.codeplex.com/releases/view/113281 http://www.nuget.org/packages/Microsoft.Owin.Security.Google/2.1.0 Upgrade your NuGet packages if you have to. – ta.speot.is May 10 '14 at 12:10

3 Answers3

6

The solution was as simple as updating the version of Microsoft.Owin.Security.Google in Nuget.

Taryn
  • 242,637
  • 56
  • 362
  • 405
Xavier Hutchinson
  • 2,207
  • 1
  • 17
  • 21
3

If you're using the 3.0.0 version of Microsoft.Owin.Security.Google, you have to turn on the Google+ API in the Google Developer Console. (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)

Jami
  • 161
  • 1
  • 4
3

You should get Microsoft.Owin.Security.Google.

In Visual Studio do the following: open Tools -> Library Package Manager -> Manage NuGet Packages for Solution ... then in search text box put Microsoft.Owin.Security.Google and choose Microsoft.Owin.Security.Google package, press "Install" to install it.

Install "Microsoft.Owin" the same way.