Saturday, December 2, 2017

What is Single Sign On (SSO)? Federated Single Sign-On SAML 2.0 with ITfoxtec Saml2

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.


  1. Open visual studio, create a ASP.net MVC Application enter image description here
  2. add itfoxtec.saml2 and itfoxtec.saml2.mvc from nuget pacakges enter image description here
  3. check the AuthController in your controller folder enter image description here
  4. Set the basic setting like Issuer url, Destination, AssertionConsumerServiceUrl
  5. 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();