Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate an MVC 4 OpenId Google Login to OAuth 2.0 or Google+ Sign-in

I have an MVC 4 web application that is currently using the out-of-the-box OpenId Google Login. This has been deprecated by Google and so, I need to migrate this to one of Google's supported methods. I have read the documentation provided by Google,OpenID 2.0 (Migration), but I still am not able to integrate the new login method with my application.
All I intend to use the Google Login for is the email address. I am not concerned with obtaining any other information from Google about the user.

My question is what steps must I take to migrate my MVC 4 web application to a supported method of Google's login?

Note: While formatting this question I came across this promising information: Web applications (ASP.NET MVC)

like image 236
AperioOculus Avatar asked Sep 23 '14 12:09

AperioOculus


1 Answers

All you have to do is create a MVC project in C#, enable Single Authorization and edit the file Startup.Auth.cs with your info:

app.UseGoogleAuthentication(new GoogleOAuth2AuthenticationOptions()
{
ClientId = "{your ID}",
ClientSecret = "{your client-secret}"
});
like image 138
parismiguel Avatar answered Nov 13 '22 10:11

parismiguel