app.UseGoogleAuthentication Does Not Accept 2 Arguments - Azure Tutorial
EDIT: 2014-07-03 MSDN just posted a blog shedding light on why this change was introduced. Long story short, Google likes breaking things for you.
If you’re following the tutorial Deploy a Secure ASP.NET MVC 5 app with Membership, OAuth, and SQL Database to an Azure Web Site you may get this error when you get to the Google auth section.
The Problem
The two parameter overload is a new feature in Microsoft.Owin.Security.Google
version 2.1.0.
The Fix
You just need to upgrade the nuget package.1
- I first installed Visual Studio 2013 Update2. This may not be strictly required, YMMV.
- Right click and remove the reference to Microsoft.Owin.Security.Google from your project
- Reinstall the package with nuget:
Install-Package Microsoft.Owin.Security.Google
That upgraded all the OAuth providers to work.
It’s a shame that VS generates boilerplate that doesn’t even compile. A meaningful warning would be nice.
Addendum
A lot of the commenters on the tutorial appear to be skimming along and not reading. If you’re having more trouble because you literally pasted
app.UseGoogleAuthentication(
clientId: "000-000.apps.googleusercontent.com",
clientSecret: "00000000000");
into your code, note that the author links you to
another walkthrough
wherein you register your app with Google. Make sure you do that too, and use
your real clientId
and clientSecret
codes.
- 1.You may be able to avoid all three of these steps by just running
Update-Package Microsoft.Owin.Security.Google
. I'm new to this, and I guess I like doing things the long way. ↩