ASP.NET Authentication - One Login System for Multiple Applications

We have a server with support for 5-10 internal ASP.NET applications (MVC), operating in separate application pools, as separate websites (on different ports and / or subdomains). I don't know anything about the built-in ASP.NET authentication platform, so I was wondering if anyone could add me a quick pointer in the right direction ...

I want to protect all internal applications through one login mechanism (supporting 3-5 different roles, nothing complicated). This login system will be another application / website running on the server, and to access any other application, it is necessary to authenticate through one login system, and the target application should be able to see the user role. Internal applications will be changed at the code level to connect to this new login system (in other words, we will change the current applications to support authentication).

The thing is that I do not want each application to have its own login / authentication mechanism, but rather use a more "global" authentication system (all on one server). I'm not looking for anything complicated (just a company of 15-25 employees, 3-5 departments - each user should be associated with a department (role) based on his login - and each application will be configured to show the user the corresponding data based on his roles).

Question: how to make the user authentication status visible in all different applications (in different assemblies and works separately)?

Do I need to use forms authentication? Or something in Spring.NET?

+7
source share
2 answers

Single sign-on is relatively easily achieved within a subdomain or second level domain. ASP.NET Forms Authentication is a ticket-based system where the ticket is stored encrypted in a cookie. You must ensure that your web applications can share this cookie.

For a subdomain script (e.g. mysite.com/app1, mysite.com/app2) just set the encryption/decryption keys to the same in machinekey in the web.config files.

For a second-level domain script (for example, app1.mysite.com, app2.mysite.com), in addition to the above, you need to make some code changes to force all authentication cookies to use the same top-level domain (for example, mysite.com).

+4
source

If your company runs on Windows and you have an internal Active Directory service (Active Directory Domain Services), you can configure all of your ASP.NET sites to use integrated Windows authentication. It is very simple to configure and very common for intranet sites. Users accessing your internal sites are automatically authenticated using their Windows Identity, which means there is no need for a username and password login form. Read more here: http://www.asp.net/mvc/tutorials/authenticating-users-with-windows-authentication-cs

+1
source

All Articles