简体   繁体   中英

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.

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)

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.

All you would need to do is ensure the forms authentication settings are the same in both of the web.config files. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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