Google OWIN Gotcha

I was implementing an OWIN authentication using Google Id for one of our projects when I with a wall. For some reason, Google is not returning anything despite successful authorization. I was screaming at my screen for half an hour. It turns out there’s one sneaky gotcha I would’ve never guessed.

  1. Enable the Google+ API. This is one hidden b**** of a gotcha and is the root cause of the problem in the question here – if you don’t do this, it’s easy to miss that the Request to /account/ExternalLoginCallback includes &error=access_denied, and that’s because Google said no to a permissions request OWIN made for the user’s Google+ basic profile. I can’t tell whose fault this is, Google’s or Microsoft’s.