It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center
                            
                        
                    
                
                                7年前关闭。
            
                    
我有一个工作门户网站项目,我需要使用Google开放身份验证来注册用户..以便我可以检索他/她的帐户详细信息,例如名字,姓氏,电子邮件地址,手机号码等。
同样在asp.net中也使用yahoo。

最佳答案

检查DotNetOpenAuth。这是一个.NET库,用于将google / yahooo /开放ID登录支持集成到您的.NET应用程序中。

这就是它的工作方式。

您在网站(google / yahoo等)中显示“不同”登录选项,并且当用户单击时,它们将被重定向到这些提供程序的登录页面。您将传递一个页面的url(类似回调!!),以便在成功通过身份验证后,提供的页面将重定向到您的该虚拟页面。您将不会获得用户的密码。您将获得与该帐户相对应的OpenID字符串。您可能需要将其存储在UserInfo表中,以便下次用户访问时,通过身份验证后,您可以携带与用户相关的资料(配置文件首选项等)。

我认为您将无法检索用户的手机号码。您可以获取用户的电子邮件ID。

互联网上有很多例子。

http://midnightprogrammer.net/post/Add-Google-Login-Support-In-ASPNET-With-OAuth.aspx

http://danhounshell.com/blog/adding-openid-to-your-web-site-in-conjunction-with-asp-net-membership/

关于c# - 使用C#将google帐户添加到asp.net的我的网站中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/11245396/

10-17 02:45