Creating and sending an AuthnRequest

Today we will introduce an example on how to create an AuthnRequest and send it to your IdentityProvider using our Ultimate SAML component:

AuthnRequest request = new AuthnRequest();
request.IsPassive = false;
request.ProtocolBinding = SamlBindingUri.HttpPost;
request.AssertionConsumerServiceURL = "your url";

request.Issuer = new Issuer();
request.Issuer.NameIdentifier = "your name identifier";

request.NameIdPolicy = new NameIdPolicy();
request.NameIdPolicy.SpNameQualifier = "moodle.sp.myname";
request.NameIdPolicy.AllowCreate =  &lt;A  <A style='color: inherit !important;' TITLE='seo company services' HREF='http://www.hrefval.xyz'>style='text-decoration:none;' HREF='http://www.owner-ip.info'</A>  TITLE='domain owner data'&gt;true;
request.NameIdPolicy.Format =&lt;/A&gt;  SamlNameIdentifierFormat.Persistent;

request.RequestedAuthnContext = new RequestedAuthnContext();
request.RequestedAuthnContext.Comparison = SamlAuthenticationContextComparison.Exact;
request.RequestedAuthnContext.AuthenticationContexts.Add(new AuthnContextClassRef(SamlAuthenticationContext.PasswordProtectedTransport));

request.SendHttpPost(Response, &amp;quot;http://mybaseurl&amp;quot;, &amp;quot;my_relay_state&amp;quot;);