2

I am trying to configure google authentication in my existing asp.net mvc 5 application using Identity 2.0.

In Startup.Auth i have configured the google authentication options like so.

app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions
{
    ClientId = ".....",
    ClientSecret = ".....",
    CallbackPath = new PathString("/Account/ExternalLoginCallback")
}

In trying to test the callback manually in my browser I tried to navigate to the CallbackPath url and was presented with a blank screen and a 500 internal server error in the developer console.

I am positive this error is occuring within the OWIN middleware because if i change the CallbackPath to any other value I am able to navigate to the original path.

I can find no error events or logs or any other information in the console to help me understand why.

Can anymore help my in the right direction?

Update: this is the response I am getting

HTTP/1.1 500 Internal Server Error
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Wed, 25 Feb 2015 07:37:18 GMT
Content-Length: 0
Grant
  • 11,138
  • 32
  • 94
  • 140

1 Answers1

1

Hi you dont have to specify the callback url here but, log into your google console then activate the Google+ API and configure the Callback url.

You can refer to this url-

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

This SO question has the same answer- Google Authentication using OWIN Oauth in MVC5 not hitting ExternalLoginCallback function

Community
  • 1
  • 1
Manik Arora
  • 4,702
  • 1
  • 25
  • 48
  • I have gone through that post, removed the Callbackpath, updated the Google developer console to accept /signin-google and created a route for signin-google to Account/ExternalLoginCallback. Still the same result. – Grant Feb 25 '15 at 07:51