How to migrate OpenID to OAuth in asp.net mvc4
Asked Answered
C

1

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

Cornie answered 19/6, 2014 at 10:23 Comment(2)
Hi, Any body got solution ?Lovel
you can use Nuget package managerSherrilsherrill
S
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.

Silvey answered 30/1, 2018 at 11:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.