What is Single Sign On (SSO)?
Single sign-on (SSO) is a session and user authentication service that permits a user to use one set of login credentials (e.g., name and password) to access multiple applications.
Logging in multiple times can be eliminated with Single Sign On i.e. user has to login only once and can access web multiple applications. Implementing SSO with ITfoxtec SAML 2.0 in ASP.NET MVC is very simple. Below is the step by step approach to implement it.
add itfoxtec.saml2 and itfoxtec.saml2.mvc from nuget pacakges
Set the basic setting like Issuer url, Destination, AssertionConsumerServiceUrl
get the identity in AssertionConsumerService method using given below code
var useridentity = saml2AuthnResponse.ClaimsIdentity as ClaimsIdentity; var username = useridentity.Claims.Where(c => c.Type == "username") .Select(c => c.Value).SingleOrDefault();