简体   繁体   English

如何将谷歌、脸书等账号的社交登录插入到你现有的经典asp.net制作的认证系统中?

[英]How to plug-in social login with Google, Facebook and other accounts into your existing authentication system made by classic asp.net?

I'm looking at ways to incorporate social logins to log in with accounts like Google/Facebook/Twitter, etc. into an authentication system that integrates web applications created on several different platforms.我正在研究如何将社交登录与 Google/Facebook/Twitter 等帐户的登录结合到一个身份验证系统中,该系统集成了在多个不同平台上创建的 Web 应用程序。 I'd like to hear your constructive feedback on whether the plan I'm currently considering is reasonable.我想听听您对我目前正在考虑的计划是否合理的建设性反馈。

1. The explanation for target system. 1. 目标系统说明。

I am responsible for the program maintenance and ongoing refurbishment of the authentication system for a website system with one million members.我负责一个拥有 100 万会员的网站系统的身份验证系统的程序维护和持续翻新。

This website consists of more than 10 different applications with several different developping platforms.该网站由 10 多个不同的应用程序和几个不同的开发平台组成。 The core of the authentication system that integrates these applications was created in ASP.NET 4.0, and the basic part of the authentication is done using form authentication, not ASP.NET Identity.集成这些应用程序的身份验证系统的核心是在 ASP.NET 4.0 中创建的,身份验证的基本部分是使用表单身份验证完成的,而不是 ASP.NET Identity。

Ninety percent of the members of this site are created based on the membership information provided by the companies that use the site's services, and 10 percent of the members are created by registering themselves as members.本网站90%的会员是根据使用本网站服务的公司提供的会员信息创建的,10%的会员是通过将自己注册为会员而创建的。

2.Proposition 2.命题

As I mentioned first, I'm planning to incorporate social login into the website's authentication system, which allows users to log in with their Google/Facebook/Twitter accounts.正如我首先提到的,我计划将社交登录纳入网站的身份验证系统,允许用户使用他们的 Google/Facebook/Twitter 帐户登录。 For existing members, after entering the website after authentication, they will be able to set up social login from a dedicated page.对于现有会员,通过身份验证进入网站后,他们将能够从专用页面设置社交登录。

3.Question 3.问题

I would like to ask you all if I have the right idea for building this system.我想问大家我是否有构建这个系统的正确想法。 My plan is as follows.我的计划如下。

  1. Create a web service to link website members with any social networking accounts, and call them from the member master management page on the web application side.创建一个 Web 服务,将网站成员与任何社交网络帐户联系起来,并从 Web 应用程序端的成员主管理页面调用它们。
  2. Create this Web service in ASP.NET Core and use Identity, copy the "\\Identity\\Identity\\Manage\\ExternalLogin.cshtml" created by Scafolding to a new page, accept the Post instruction, and Customize the methods that are executed when you use.在ASP.NET Core中创建这个Web服务并使用Identity,将Scafolding创建的“\\Identity\\Identity\\Manage\\ExternalLogin.cshtml”复制到新页面,接受Post指令,自定义使用时执行的方法. (The name of the method is 'OnPostLinkLoginAsync' and 'OnGetLinkLoginCallbackAsync'). (该方法的名称是“OnPostLinkLoginAsync”和“OnGetLinkLoginCallbackAsync”)。

About using ASP.NET Core Identity关于使用 ASP.NET Core 标识

advantage优势

  • Since all the troublesome OAuth communication will be black boxed out, I can expect the coding will be minimal.由于所有麻烦的 OAuth 通信都将被黑盒化,我可以预期编码将是最少的。
  • Even if the specification of OAuth on the SNS side changes in the future, it is expected that Identity will be upgraded to cope with the change and we don't need to modify our own program.即使未来SNS端的OAuth规范发生变化,预计Identity也会升级以应对变化,我们不需要修改自己的程序。

Drawbacks.缺点。

  • The web service side of this web service will still have Identity features that you don't actually use, so they need to be kept secret from regular members.此 Web 服务的 Web 服务端仍将具有您实际上并未使用的身份功能,因此需要对常规成员保密。

4.Finally 4.最后

I'm sure there are many examples of medium and larger web systems that embed social login functionality into existing authentication.我确信有许多中型和大型 Web 系统的示例将社交登录功能嵌入到现有的身份验证中。 I would be very happy to receive better methods and advice from those who have experienced this kind of development.我很乐意从那些经历过这种发展的人那里得到更好的方法和建议。

I have changed the place for this argument to the following thread inf ASP.NET Forum.我已将此参数的位置更改为以下线程 inf ASP.NET Forum。

https://forums.asp.net/t/2170679.aspx?How+to+plug+in+social+login+with+Google+Facebook+and+other+accounts+into+your+existing+authentication+system+made+asp+net+4+0 https://forums.asp.net/t/2170679.aspx?How+to+plug+in+social+login+with+Google+Facebook+and+other+accounts+into+your+existing+authentication+system+制造+asp+net+4+0

Please check above for the following arguments.请检查上面的以下参数。

Thank you.谢谢你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM