8

I am using asp.net mvc 4 template, which ships with OpenID2 as default.

Since google has depricated OpenID 2.0, I want to use OAuth 2.0. I checked all MSN blogs where there is no solution for out of box. I am using visual studio 2012 and mvc 4 only.

So my question is how can i migrate openid 2.0 to open auth.

Thanks & Regards, Aruljothi

1 Answers1

0

You can either get GoogleOAuth2Client from NuGet or reimplement it yourself: You'll have to create a new GoogleAuth model which implements IAuthenticationClient interface, can be initialized with appId and appSecret, returns provider name ("gooogle") and includes specific classes and methods to complete the auth, get user data and deserialize data.

If you are too lazy to do that you can even use Google's own library Google.Apis.Auth.OAuth2. Or look for ready-to-use template implementations.

After that all you need to do is configure your AuthConfig and use them via OAuthWebSecurity in your external login controller.