/// <summary> /// Transfers the message to the given endpoint using the HTTP-Redirect binding. /// </summary> protected static void HTTPRedirect(SAMLAction action, IDPEndPointElement endpoint, XmlNode message) { if (message.FirstChild is XmlDeclaration) { message.RemoveChild(message.FirstChild); } HttpRedirectBindingBuilder builder = new HttpRedirectBindingBuilder(); if (action == SAMLAction.SAMLRequest) { builder.Request = message.OuterXml; } else { builder.Response = message.OuterXml; } builder.signingKey = IDPConfig.IDPCertificate.PrivateKey; UriBuilder url = new UriBuilder(endpoint.Url); url.Query = builder.ToQuery(); HttpContext.Current.Response.Redirect(url.ToString(), true); }
/// <summary> /// Transfers the message to the given endpoint using the HTTP-Redirect binding. /// </summary> protected static void HTTPRedirect(SAMLAction action, IDPEndPointElement endpoint, XmlNode message) { if (message.FirstChild is XmlDeclaration) message.RemoveChild(message.FirstChild); HttpRedirectBindingBuilder builder = new HttpRedirectBindingBuilder(); if (action == SAMLAction.SAMLRequest) builder.Request = message.OuterXml; else builder.Response = message.OuterXml; builder.signingKey = IDPConfig.IDPCertificate.PrivateKey; UriBuilder url = new UriBuilder(endpoint.Url); url.Query = builder.ToQuery(); HttpContext.Current.Response.Redirect(url.ToString(), true); }
/// <summary> /// Initializes a new instance of the <see cref="HttpPostBindingBuilder"/> class. /// </summary> /// <param name="endpoint">The IdP endpoint that messages will be sent to.</param> public HttpPostBindingBuilder(IDPEndPointElement endpoint) { _destinationEndpoint = endpoint; _action = SAMLAction.SAMLRequest; _relayState = string.Empty; }