At my company we have a very old asp.net website project NOT web application. We are recreating parts of this site in MVC 5. However for a time, both sites will co-exist. I need from the old website project to be able to click a link and then be passed to
the MVC 5 application but to be automatically authenticated. I am not sure this is even possible but I have to ask.
OLD website project: https://oldsite.company.com
NEW MVC 5: https://newMVC5.company.com
Thanks for any input!
If you host both your sites on the same server, you can easily share authentication cookies. Can you do like this
It depends upon Auth scheme. If you are using form auth then you can continuously use form auth in MVC.
Base on my test, we can share the authentication between sub domains.
So, for this requirement, please share the authentication in your old website.
<authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" domain=".company.com" /> </authentication>
More information, please refer to:
# Forms Authentication Across Applications
Just make sure both web.configs supply the same <machineKey> element so the encrypted cookies are valid on both applications.