title: Single Sign On implementation in C# using SAML 2.0
body: <p>For past week I did a lot of research on the topic of using Single Sign On with <code>SAML 2.0</code>. I have found a lot of good articles and I understand the process of SSO in detail, but I am encountering problems when implementing it in our <code>C#</code> solution with .Net Framework 4.5. </p>
  
  <p>Let me describe my understanding of the process and how I imagine I should go about applying it:</p>
  
  <ol>
  <li><p>The user goes to our software which is the Service Provider (SP). We are having different instances trimmed to our client's needs.</p></li>
  <li><p>After typing the email address, he should be re-directed to our
      Identity Provider (IdP). At this point I believe I should be sending
      an authentication token to check if the user is not already logged
      in on the IdP. In case the user is, I would want to login the user
      to our system. In case he is not, he would then log in on their IdP.</p></li>
  <li>After he successfully is authenticated, we are sending the <code>SAML</code> Response token back to our website URL. </li>
  <li>When the token arrives at our end, we should decrypt it and when the authentication has been successfully, grant the user access to the service.</li>
  </ol>
  
  <p>So far I haven't found any good resources on the actual process of generating the SAML Request or a way of decrypting our <code>SAML</code> token in the <code>C#</code> code.</p>
  
  <p>For the testing we are using ADFS 2.0 as the IdP and we are getting the <code>SAML</code> Response from it. When we will process the response we would like to compare the information in our database with the email in the response to verify the users details before letting them into the system. </p>
  
  <p>The examples I have been able to find are either out of date or are not giving detailed explanation. If anyone would be able shine some light on it for me, by either providing some examples of implementation or a good and up to date resource that I haven't yet managed to find.</p>