简体   繁体   English

ASP.Net Webforms和MVC(不同的数据库和域)中的单点登录

[英]Single Sign-On in ASP.Net Webforms and MVC (different databases and domains)

I'm confused about my situation. 我对自己的情况感到困惑。 I have separate applications (ASP.NET 4.0 Web Forms and ASP.MVC) deployed in different machines (and domains) and each has its own Users and Roles structures (separate MS SQL databases). 我在不同的计算机(和域)中部署了单独的应用程序(ASP.NET 4.0 Web窗体和ASP.MVC),每个应用程序都有自己的用户和角色结构(单独的MS SQL数据库)。 MVC app is currently in early implementing phase. MVC应用目前处于早期实施阶段。 Web forms app works on production environment. Web表单应用程序可在生产环境中使用。

What I need to do is to implement SSO betweent these apps. 我需要做的是在这些应用之间实现SSO。 I want to have automatic authentication - after log into asp.net web forms application I need to be authenticated by asp.mvc application side. 我想要自动身份验证-登录到asp.net Web窗体应用程序后,我需要由asp.mvc应用程序端进行身份验证。

I know that the requirements to implement SSO via auth cookie is to have both application working on common database and domain (or sub-domain) but there are really no possibilities to have SSO with minimum effort in my case? 我知道通过auth cookie实施SSO的要求是使应用程序都可以在公共数据库和域(或子域)上运行,但是在我的情况下,真的没有可能以最小的努力获得SSO吗?

Currently I have 2 ideas: 目前我有2个想法:

1) use 3rd party tools (OAuth?) - but I didnt read about it yet 1)使用第三方工具(OAuth?)-但我尚未阅读

2) create some WCF serivces on Mvc side to authenticate users: Web forms app will send login and password (hash?) via wcf service (encrypted data) and mvc app will validate this data. 2)在Mvc端创建一些WCF服务以验证用户身份:Web窗体应用程序将通过wcf服务(加密数据)发送登录名和密码(哈希?),而mvc应用程序将验证此数据。 After positive validation mvc app will start FORMS authentication for this login and password. 经过肯定的验证后,MVC应用程序将为此登录名和密码启动FORMS身份验证。

I'm not sure if any of my concept is possible and safe. 我不确定我的任何概念是否可行和安全。

Do you agree any of these 2 concept or have any other suggestions about solution of my problem? 您是否同意这两个概念中的任何一个或对解决我的问题有其他建议? I will be grateful for your help. 感谢您的帮助。


EDITED - explanation the need 编辑-解释需求

Its our customer requirement - web form app is old and it currently works on production environment. 它是我们的客户要求-Web表单应用程序很旧,目前可在生产环境中使用。 It has own custom memebrship providers connected to Users and Roles MSSQL database tables. 它具有自己的自定义memebrship提供程序,该提供程序已连接到“用户”和“角色” MSSQL数据库表。 The new application will be written in asp.mvc 4 and will have own users registartion page and Users structures etc. It must be deployed on different machine. 新的应用程序将用asp.mvc 4编写,并具有自己的用户注册页面和用户结构等。它必须部署在不同的计算机上。

Some Users of old application will be replicated (on start) in new application because they must see some functionalities of new appllication after log into old one. 一些旧应用程序的用户将被复制(在启动时)在新应用程序中,因为他们在登录到旧应用程序后必须看到新应用程序的某些功能。 It must looks like from their point of view that new application is part (new module) of old web forms application. 从他们的角度看,新应用程序必须是旧Web表单应用程序的一部分(新模块)。 On the other hand, the new application has to be independent and will be some pool of users that they will use new app only. 另一方面,新应用程序必须是独立的,并且将是一些仅使用新应用程序的用户。 Both applications will be integrated in case of one business process only (orders synchronization via wcf or rest services). 仅在一个业务流程的情况下将集成这两个应用程序(通过wcf或rest服务进行订单同步)。


We worked on some thing similar to your problem.But in my case the two domains are under the control of same AD server.By using the Cookie sharing across domains we are cross checking the SSO. 我们正在处理与您的问题类似的事情,但是在我的情况下,这两个域在同一AD服务器的控制下。通过跨域使用Cookie共享,我们可以对SSO进行交叉检查。 Follow this Link 跟随此链接

您可以使用IdentityServer3之类的方法来实现Idp(aka STS或OpenID提供程序),并选择一个数据库用户作为内部身份验证提供程序,并选择其他数据库用户作为外部身份验证提供程序。

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

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