I have a solution that has two applications. Is it possible to make the user sign in only once?
For example, in the main application I do authentication like this:
FormsAuthentication.SetAuthCookie(ContactFound.ContaLogin, model.RememberMe);
And I put this code in the web.config file:
<authentication mode="Forms">
<forms
loginUrl="~/Account/LogIn"
defaultUrl="~/Account/LogOn"
timeout="15"
/>
</authentication>
What should I add, so that, when the user is logged in, in the main application we don’t ask him to log in again when he connect to the second application?
Since you are going to host both applications at the same address, it should be easily possible by setting the
<machineKey>(web.config) to the same value for both applications. After that, you should automatically be logged in to one application after logging in to the other.Further reading: