[JIRA] (OSJ-366) NoSuchMethodError in SAML20AssertionValidator::validate

Christian Kriz (Jira) jira at shibboleth.atlassian.net
Mon Nov 28 10:31:17 UTC 2022


Christian Kriz ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=638480fb00cb2fc3f988e65d ) *created* an issue

OpenSAML - Java ( https://shibboleth.atlassian.net/browse/OSJ?atlOrigin=eyJpIjoiMmMyOWYwYmE5MmNiNDcxMWIxN2JiMjFjZDUxN2VjNGMiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/OSJ-366?atlOrigin=eyJpIjoiMmMyOWYwYmE5MmNiNDcxMWIxN2JiMjFjZDUxN2VjNGMiLCJwIjoiaiJ9 ) OSJ-366 ( https://shibboleth.atlassian.net/browse/OSJ-366?atlOrigin=eyJpIjoiMmMyOWYwYmE5MmNiNDcxMWIxN2JiMjFjZDUxN2VjNGMiLCJwIjoiaiJ9 ) NoSuchMethodError in SAML20AssertionValidator::validate ( https://shibboleth.atlassian.net/browse/OSJ-366?atlOrigin=eyJpIjoiMmMyOWYwYmE5MmNiNDcxMWIxN2JiMjFjZDUxN2VjNGMiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 4.0.1, 4.2.0 Assignee: Brent Putman ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A97de0981-adc3-4044-95ed-131622fad81e ) Components: SAML 2 Core Created: 28/Nov/22 5:31 AM Priority: Trivial Reporter: Christian Kriz ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=638480fb00cb2fc3f988e65d )

Using SAML20AssertionValidator’s validate method like in this excerpt:

try {
   ValidationContext context = new ValidationContext(validationParameters);
   ValidationResult validate = saml20AssertionValidator.validate(assertion, context); // <---- Exception thrown here
   if (validate != ValidationResult.VALID) {
       throw new InvalidSamlResponseException(context.getValidationFailureMessage());
   }
} catch (AssertionValidationException e) {
   throw new InvalidSamlResponseException(e);
}

throws

java.lang.NoSuchMethodError: com.google.common.base.Predicate.test(Ljava/lang/ Object ;)Z
net.shibboleth.utilities.java.support.logic.PredicateSupport.and(PredicateSupport.java:129)

This seems to be an issue stemming from usage of Google’s guava library in OpenSAML’s PredicateSupport.java, where the line #129

return Predicates.and(copy)::test;

calls com.google.common.base.Predicates which has a method apply and equals , but not test.

Maven’s OpenSAML 4.2.0 ( https://mvnrepository.com/artifact/org.opensaml/opensaml-core/4.2.0 ) depends on guava 31.1. Earlier versions of guava exist, which seem to support OpenSAML’s usage of Predicates like shown above, but neither guava 31.1 used by OpenSAML 4.2.0 nor guava 28.2 used by OpenSAML 4.0.1 have that method Predicates::test.

OpenSAML 3.4.6 seems unaffected by this erroneous behavior.

( https://shibboleth.atlassian.net/browse/OSJ-366#add-comment?atlOrigin=eyJpIjoiMmMyOWYwYmE5MmNiNDcxMWIxN2JiMjFjZDUxN2VjNGMiLCJwIjoiaiJ9 ) Add Comment ( https://shibboleth.atlassian.net/browse/OSJ-366#add-comment?atlOrigin=eyJpIjoiMmMyOWYwYmE5MmNiNDcxMWIxN2JiMjFjZDUxN2VjNGMiLCJwIjoiaiJ9 )

Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:4037f92 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20221128/e1f749d9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-e81facd0-10e6-4f4a-bffd-b8d3040a12fc
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221128/e1f749d9/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-c0896643-e4fc-4035-8cec-50366625943c
Type: image/png
Size: 446 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221128/e1f749d9/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-3db7047d-5e54-41bf-ac56-8066522756ca
Type: image/png
Size: 345 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221128/e1f749d9/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-e2c578ac-0966-4f65-9b12-4872c522c152
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20221128/e1f749d9/attachment-0007.png>


More information about the commits mailing list