title: SAML2 Authentication using ASP.NET with ADFS Federation meta data
body: <p>I am trying to implement the SAML2 authentication from <strong>ASP.NET Web Application(SP)(.Net Framework 4.0) with ADFS(IdP)</strong>. I had integrated SAML2.o nugget and tried to many ways to get the credential inputs from HTML form and Post the SAML Response. But unable to display the input form and get the SAML Response?</p>
  <p>Here is my sample source code : (I have implement the HTTP Post Binding)</p>
  <pre><code>StringBuilder sb = new StringBuilder();
  Saml20AuthnRequest samlRequest = ADFSRequest.GetDefault();
  samlRequest.Request.Destination = ConfigurationManager.AppSettings[&quot;IdentityProviderUrl&quot;];
  samlRequest.Request.AssertionConsumerServiceUrl = ConfigurationManager.AppSettings[&quot;ServiceProviderUrl&quot;];
                      sb.Append(string.Format(&quot;{0}wia?SAMLRequest=&quot;,ConfigurationManager.AppSettings[&quot;IdentityProviderUrl&quot;]));
                      sb.Append(HttpUtility.UrlEncode(Convert.ToBase64String(Encoding.UTF8.GetBytes(samlRequest.GetXml().OuterXml))));
                      sb.Append(&quot;&amp;client-request-id=&quot;).Append(samlRequest.Id);
                      HttpContext.Current.Response.Redirect(sb.ToString(),false);
                      HttpContext.Current.ApplicationInstance.CompleteRequest();
  </code></pre>
  <p>Anyone can help to implement the SAML2 in ASP.Net application?
  Note: I don’t want to use any thirty-part tools and open source is fine.</p>