ArtifactResolve signed twice

46 views Asked by At

I am having trouble creating an ArtifactResolve because it seems to get signed twice when I try to bind it. Perhaps my setup is wrong?

In the end, the XML document has two Signature nodes.

Saml2Configuration samlConfig = new Saml2Configuration
            {
                Issuer = "issuer.com",
                SigningCertificate = cert,
                SignatureAlgorithm = "mysignalg",
                SignAuthnRequest = true,
            };

Saml2ArtifactResolve artifactResolve = new Saml2ArtifactResolve(samlConfig)
            {
                IdAsString = "_" + Guid.NewGuid().ToString("N"),
                Artifact = artifact
            };

artifactResolve.Validate();
Saml2PostBinding binding = new Saml2PostBinding();
return binding.Bind(artifactResolve);

Update:

When using ArtifactBinding, I get a null reference exception.

Saml2Configuration samlConfig = new Saml2Configuration
            {
                Issuer = "msomething.nl",
                SigningCertificate = cert,
                SignatureAlgorithm = SingatureAlgorithm,
                SignAuthnRequest = true
            };

Saml2ArtifactResolve artifactResolve = new Saml2ArtifactResolve(samlConfig)
            {
                IdAsString = "_" + Guid.NewGuid().ToString("N"),
                Artifact = artifact,
                Destination = new Uri("http://mydestination"),
            };

            artifactResolve.Validate();
            Saml2ArtifactBinding binding = new Saml2ArtifactBinding();
            binding.RelayState = Guid.NewGuid().ToString();

            return binding.Bind(artifactResolve);
1

There are 1 answers

2
Anders Revsgaard On BEST ANSWER

You cannot bind the Artifact Resolve with a POST binding, you need to use a Artifact binding. Please se the IdP sample.

And the relaying party artifact sample.