[JIRA] (OSJ-341) DiscoveryResponseBuilder defaults to wrong Namespace prefix and URI

steve.osguthorpe (Jira) jira at shibboleth.atlassian.net
Tue Aug 24 13:26:43 UTC 2021


steve.osguthorpe ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=5bfd62c75f77da6929583d6c ) *created* an issue

OpenSAML - Java ( https://shibboleth.atlassian.net/browse/OSJ?atlOrigin=eyJpIjoiNWQwZjczNWMxODQ0NGZkOTgxNzIwOWU1YmQ2NjAyYmIiLCJwIjoiaiJ9 ) / Bug ( https://shibboleth.atlassian.net/browse/OSJ-341?atlOrigin=eyJpIjoiNWQwZjczNWMxODQ0NGZkOTgxNzIwOWU1YmQ2NjAyYmIiLCJwIjoiaiJ9 ) OSJ-341 ( https://shibboleth.atlassian.net/browse/OSJ-341?atlOrigin=eyJpIjoiNWQwZjczNWMxODQ0NGZkOTgxNzIwOWU1YmQ2NjAyYmIiLCJwIjoiaiJ9 ) DiscoveryResponseBuilder defaults to wrong Namespace prefix and URI ( https://shibboleth.atlassian.net/browse/OSJ-341?atlOrigin=eyJpIjoiNWQwZjczNWMxODQ0NGZkOTgxNzIwOWU1YmQ2NjAyYmIiLCJwIjoiaiJ9 )

Issue Type: Bug Affects Versions: 3.4.5 Assignee: Brent Putman ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A97de0981-adc3-4044-95ed-131622fad81e ) Components: SAML 2 Metadata Created: 24/Aug/21 9:26 AM Priority: Trivial Reporter: steve.osguthorpe ( https://shibboleth.atlassian.net/secure/ViewProfile.jspa?accountId=5bfd62c75f77da6929583d6c )

Default build method on org.opensaml.saml.ext.idpdisco.impl.DiscoveryResponseBuilder supplies the values for the "metadata" namespace instead of "idpdisco". This can result in a classcast exception when marshalling as the marshaller cannot be found as the namespace is used as a key.

Suggest change from:

   @Override
   public DiscoveryResponse buildObject() {
       return buildObject(SAMLConstants.SAML20MD_NS, DiscoveryResponse.DEFAULT_ELEMENT_LOCAL_NAME,
               SAMLConstants.SAML20MD_PREFIX);
   }

to

   @Override
   public DiscoveryResponse buildObject() {
       return buildObject(SAMLConstants.SAML_IDP_DISCO_NS, DiscoveryResponse.DEFAULT_ELEMENT_LOCAL_NAME,
               SAMLConstants.SAML_IDP_DISCO_PREFIX);
   }

or to track the constant exposed by the target type...

   @Override
   public DiscoveryResponse buildObject() {
       
       return buildObject(DiscoveryResponse.DEFAULT_ELEMENT_NAME.getNamespaceURI(), DiscoveryResponse.DEFAULT_ELEMENT_NAME.getLocalPart(),
               DiscoveryResponse.DEFAULT_ELEMENT_NAME.getPrefix());
   }

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

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#100174- sha1:b411b23 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://shibboleth.net/pipermail/commits/attachments/20210824/9dac2249/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-comment-icon-e88a071d-6dcf-4348-8419-c864625fc343
Type: image/png
Size: 1084 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210824/9dac2249/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-trivial-acd6254a-5652-4b7d-93b6-8a3fcf48d698
Type: image/png
Size: 563 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210824/9dac2249/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-avatar-910c22e9-de31-4220-9b21-a783b6f88cd5
Type: image/png
Size: 425 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210824/9dac2249/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jira-generated-image-static-footer-desktop-logo-5bc695fc-ee5e-49dd-83fc-a227e0a53f5d
Type: image/png
Size: 10805 bytes
Desc: not available
URL: <http://shibboleth.net/pipermail/commits/attachments/20210824/9dac2249/attachment-0007.png>


More information about the commits mailing list