简体   繁体   中英

Deflate & Base64 encode posted file

I've created sample solution that post encrypted SAML file to IDP using Component Space library. The request posted successfully. However, I didn't get expected response. I communicated with the IDP who told me that The request should come across the following steps.

  1. Deflate & Base64 encode
  2. URL encode

Below are my saml.config and method that i used to send the file with test value "10" for relay state.

My question is:

Is their any way to configure saml.config file to apply requests from IDP? If no is their any workaround that i can follow?

SAML.config

<SAMLConfiguration xmlns="urn:componentspace:SAML:2.0:configuration">
<ServiceProvider Name="http://localhost:45661/"
               LocalCertificateFile="localCertificatePath.p12"/>
<PartnerIdentityProviders>

<PartnerIdentityProvider Name="Tawtheeq Online"
                         SignAuthnRequest="true"

SignatureMethod="http://www.w3.org/2000/09/xmldsig#rsa-sha1"

SingleSignOnServiceBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
                         SingleSignOnServiceUrl="Destination URL"
                         PartnerCertificateFile="IDPcertificateURL.cer"/>
</PartnerIdentityProviders>
</SAMLConfiguration>

Method:

private void TestComponentSpaceSaml()
{
   var ConsumerServiceName = "Tawtheeq Online";
   SAMLServiceProvider.InitiateSSO(Response, "10", ConsumerServiceName);
}

You should confirm with the IdP exactly which binding should be used to send the SAML authn request. If they expect the Deflate encoding this indicates they expect the HTTP-Redirect binding to be used. If that's the case, remove the SingleSignOnServiceBinding setting from your configuration so it defaults to HTTP-Redirect.

There won't be any issues with the encoding of the SAML Message being sent. No workaround is required.

You should ask the IdP for more details as to what the issue is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM