Issue validating SAML signature

Eze Ikonne ike.ikonne at aricent.com
Thu Jan 3 21:33:47 EST 2019


Hi all,

I am not sure if  this the right forum for the issue that I having, I am using opensaml-2.2.3 downloaded from shibboleth. My application is a service provider and I am trying to validate Saml Response from an IDP  that has a signed Assertion. Here is the logic that I am using

                BasicX509Credential cred = new BasicX509Credential();
                  cred.setEntityCertificate(matchedCert);
                  cred.setPublicKey(matchedCert.getPublicKey());
                  cred.setCRLs(null);

            try {
                SignatureValidator signatureValidator = new SignatureValidator(cred);
                signatureValidator.validate(sig);
                return true;
              } catch (ValidationException ex) {
                    ex.printStackTrace();
                System.out.println("******** signature validation failed");
              }


But I keep getting the following stacktrace ...

2019-01-03 21:21:03,857 [Service-0] DEBUG systemout - org.opensaml.xml.validation.ValidationException: Signature did not validate against the credential's key
2019-01-03 21:21:03,858 [Service-0] DEBUG systemout -               at org.opensaml.xml.signature.SignatureValidator.validate(SignatureValidator.java:78)
2019-01-03 21:21:03,858 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.verifySAMLSignature(SimpleSamlTokenManager.java:482)
2019-01-03 21:21:03,858 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.validateAssertionSignature(SimpleSamlTokenManager.java:370)
2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.validateSignature(SimpleSamlTokenManager.java:333)
2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.token.saml.SimpleSamlTokenManager.verifySamlAuthenticationResponse(SimpleSamlTokenManager.java:300)
2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.sso.impl.SingleSignonServiceImpl.samlTokenVerify(SingleSignonServiceImpl.java:749)
2019-01-03 21:21:03,859 [Service-0] DEBUG systemout -               at com.sterlingcommerce.component.sso.impl.SingleSignonServiceImpl$RequestListener$8.run(SingleSignonServiceImpl.java:1790)
2019-01-03 21:21:03,860 [Service-0] DEBUG systemout -               at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
2019-01-03 21:21:03,860 [Service-0] DEBUG systemout -               at java.lang.Thread.run(Thread.java:811)


I would appreciate it if anyone could point me to the right solution or maybe point out what my code is doing wrong. I have tried to run sample codes around this issue, but I have still to get any of the signature validation to be successful. Any help or suggestions would be greatly appreciated.


Thanks,

Ike Ikonne
=====================================================
Please refer to http://www.aricent.com/email-disclaimer
for important disclosures regarding this electronic communication.
=====================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/users/attachments/20190104/c7c56cd8/attachment.html>


More information about the users mailing list