Hi All,
I am very new to component space i want to use component space to send ver simple signed saml file to the IDP.
I created samp.config file on my solution as below:
<SAMLConfiguration xmlns="urn:componentspace:SAML:2.0:configuration">
<ServiceProvider Name="Derayah Financial"
LocalCertificateFile="C:\Users\dkamal\documents\visual studio 2015\Projects\stackOverFlowWeb\stackOverFlowWeb\my_bank1_signed.p12"/>
<PartnerIdentityProviders>
<PartnerIdentityProvider Name="Tawtheeq Online"
SignAuthnRequest="true"
SingleSignOnServiceUrl="
https://tawtheeq.sa:8443/identity-gateway-test/ReceiveSAMLRequest" PartnerCertificateFile="C:\Users\dkamal\documents\visual studio 2015\Projects\stackOverFlowWeb\stackOverFlowWeb\TawtheeqCert.cer"/>
</PartnerIdentityProviders>
</SAMLConfiguration>
Then i created sample method to post request to url provided by IDP as below:
private void TestComponentSpaceSaml()
{
string ConsumerServiceName = "Tawtheeq Online";
Request.ContentType = "application/x-www-form-urlencoded";
SAMLServiceProvider.InitiateSSO(Response, "10", ConsumerServiceName);
}
But it is not working notice that the sample request send by IDP to follow is as below:
<?xml version="1.0" encoding="UTF-8"?>
<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" AssertionConsumerServiceURL="
https://tawtheeq.sa/mybank1/ReceiveSAMLResponse" Destination="
https://tawtheeq.sa/identity-gateway/ReceiveSAMLRequest" ForceAuthn="false" ID="_964484d741502e19a0b148d478a64050" IsPassive="false" IssueInstant="2018-06-04T12:46:07.860Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Version="2.0">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">MyBank1
</saml:Issuer><ds:Signature xmlns:ds="
http://www.w3.org/2000/09/xmldsig#"> <ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="
http://www.w3.org/2001/10/xml-exc-c14n#"/> <ds:SignatureMethod Algorithm="
http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> <ds:Reference URI="#_964484d741502e19a0b148d478a64050">
<ds:Transforms>
<ds:Transform Algorithm="
http://www.w3.org/2000/09/xmldsig#enveloped-signature"/> <ds:Transform Algorithm="
http://www.w3.org/2001/10/xml-exc-c14n#"><ec:InclusiveNamespaces xmlns:ec="
http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="ds saml samlp"/></ds:Transform>
</ds:Transforms>
<ds:DigestMethod Algorithm="
http://www.w3.org/2000/09/xmldsig#sha1"/> <ds:DigestValue>B99CKUkHBSVelX86anIYMPaktnw=</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>
Some Encrypted key
</ds:SignatureValue>
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>
Some Encrypted key
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</ds:Signature>
<samlp:NameIDPolicy AllowCreate="true" Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"/>
<samlp:RequestedAuthnContext Comparison="exact">
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
</samlp:AuthnRequest>