本文介绍了Asp.Net MVC 4使用OAuth2以谷歌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在努力使与谷歌登陆为现有的asp.net MVC 4项目。但现在谷歌已经宣布德的OpenID 2.0的precation,并建议使用的OAuth2。我们发现这个为mvc5项目链接。我们怎样才能做到这一点的ASP.NET MVC 4项目?谢谢

We are trying to enable "login with google" for an existing asp.net MVC 4 project. But now google has announced deprecation of OpenID 2.0 and suggested to use OAuth2. We found this link for mvc5 project. How can we do this in ASP.NET mvc 4 project? Thanks

推荐答案

我在AuthConfig.cs文件注册新客户,谷歌的OAuth。 Jerrie Pelser解释在这里 。

I had to register new client for google oAuth in AuthConfig.cs file. Jerrie Pelser explained it here. Since I was looking for login with google account not google+, I just had to update scope to https://mail.google.com.

这篇关于Asp.Net MVC 4使用OAuth2以谷歌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-25 04:39