[英]Two different applications with the login page in one of them
I've made 2 distinct solutions, but one of them has a login page. 我提出了两种不同的解决方案,但是其中一种具有登录页面。 I want that when you log in the application, my client will be able to access the second application also. 我希望当您登录该应用程序时,我的客户端也能够访问第二个应用程序。 If my client haven't logged in the application and try to access any application, he will be redirected to the Login page that exists only in one solution. 如果我的客户尚未登录该应用程序并尝试访问任何应用程序,则将其重定向到仅在一种解决方案中存在的“登录”页面。
Solution 1
- Login page
- Ui
solution 2
- Ui
To do a validation in my Solution 1 is simple because my Login page exists there, but I don't know how can I see in my Solution 2 if the client is already logged in. 在解决方案1中进行验证很简单,因为其中存在“登录”页面,但是我不知道如何在解决方案2中看到客户端是否已经登录。
Can you give me some tips ? 你能给我一些提示吗?
I read this article and tried to implement the code but in my case, exists 2 different applications (solutions) 我阅读了这篇文章并尝试实现代码,但就我而言,存在2个不同的应用程序(解决方案)
Both of them will run under the same domain 它们都将在同一域下运行
As they are both hosted on the same domain they can both share the same forms authentication cookie. 由于它们都托管在同一个域中,因此它们都可以共享相同的表单身份验证cookie。
All you would need to do is ensure the forms authentication settings are the same in both of the web.config files. 您需要做的就是确保两个web.config文件中的表单身份验证设置都相同。 This way when an unauthorised user tries to access Solution 2, it will redirect them to Solution 1 (As that will be the loginUrl
attribute in the web.config) to login. 这样,当未经授权的用户尝试访问解决方案2时,会将他们重定向到解决方案1(因为这将是web.config中的loginUrl
属性)以登录。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.