Skip to content

Conversation

@landreev
Copy link
Contributor

@landreev landreev commented May 19, 2025

What this PR does / why we need it:

See the issue. In short, the shibboleth framework had to be reconfigured since InCommon has discontinued the metadata feed around which our current implementation was built. The new implementation is based on the recommended replacement parts - the MDQ protocol for the federation metadata and the WayFinder service for the login page authentication redirect.

Which issue(s) this PR closes:

Special notes for your reviewer:

I preserved the old, DiscoFeed-based implementation, in case an instance has a need to keep using it. I'm guessing a use case for this will be an installation that is not part of InCommon, that got their shib. auth. to work with a static XML metadata file. They cannot use, and have no need for switching to WayFinder, so they will be able to keep their old setup intact by setting one feature flag.

In order to make the WayFinder redirect, Dataverse needs to supply the entityID of itself as a Service Provider. In most cases this will be the siteUrl + "/sp", but it's not guaranteed. One way of knowing this entityID would be to add a required configuration setting for it. Which I chose not to do in favor of calling shibd to retrieve it. One other option would be to just read it from the config file /etc/shibboleth/shibboleth2.xml, since shibd is almost certainly running on the same server. But I figured there may be some complicated load balancer situation where that is not the case. So I went to some trouble of making Dataverse call /Shibboleth.sso/Metadata once, on startup, when the authentication provider is initiated, where it is then cached for shibservice to use. Feedback welcome about this implementation.

Suggestions on how to test this:

A Dataverse instance with Shibboleth configured and properly registered with InCommon is required to test the functionality. I'm going to proceed with obtaining the registration for dataverse-internal, which hopefully will be done by the time the PR goes into QA. [this is still pending as of 05-27]

I will try to add more info here, on specific parts that need to be tested and confirmed.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

Is there a release notes update needed for this change?:

Additional documentation:

Preview at https://dataverse-guide--11502.org.readthedocs.build/en/11502/installation/shibboleth.html#identity-federation

landreev added 9 commits May 7, 2025 09:20
…out relying on discoffeed;

wayfinder redirect url is still hard-coded;
the overall setup is working on the unc test box. #11404
… new InCommon

Wayfinder service.
Before I make a pr, I want to put back a DiscoFeed-based login workflow, as a
configurable option, just in case some instance out there has a reason to keep using it. #11404
…discofeed will no longer be part of the setup when using InCommon. #11404
resolved conflicts:
	doc/sphinx-guides/source/installation/shibboleth.rst
@github-actions github-actions bot added FY25 Sprint 21 FY25 Sprint 21 (2025-04-09 - 2025-04-23) FY25 Sprint 22 FY25 Sprint 22 (2025-04-23 - 2025-05-07) FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) Size: 50 A percentage of a sprint. 35 hours. labels May 19, 2025
@landreev landreev moved this to Ready for Review ⏩ in IQSS Dataverse Project May 19, 2025
@coveralls
Copy link

coveralls commented May 19, 2025

Coverage Status

coverage: 23.424% (-0.03%) from 23.456%
when pulling a507380 on 11404-shib-login-mdq
into f223fb2 on develop.

@landreev landreev changed the title 11404 shib login mdq Login page and Shibboleth auth refactored to work with new InCommon services May 19, 2025
@github-actions

This comment has been minimized.

@pdurbin pdurbin moved this from Ready for Review ⏩ to In Review 🔎 in IQSS Dataverse Project May 19, 2025
@pdurbin pdurbin self-assigned this May 19, 2025
@github-actions

This comment has been minimized.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made some tweaks to the docs in 4ecb090 and I'm leaving a little non-critical feedback in this review. I hope I'm understanding the InCommon vs non-InCommon divide properly! Overall, this is great!


String baseUrl;
if (FeatureFlags.SHIBBOLETH_USE_LOCALHOST.enabled()) {
baseUrl = "http://localhost";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

http://localhost is hard coded here and in the shibservicebean (within the string http://localhost/Shibboleth.sso/DiscoFeed). Should http://localhost be factored into a common location? Should https://localhost (https instead of http) be an option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually needs to be http:, not https: - since that will result in a failure if called from Java, since the ssl certificate is not going to be valid for localhost. And this in turn was the main reason why I chose not to make this the default behavior, since calling http://localhost/Shibboleth.sso/DiscoFeed would not work on an instance that followed our recommendations for the Apache configuration. I.e., things would break for most Shibboleth-using instances without a configuration change - and, seeing how this localhost gimmick is extremely unlikely to be needed by any instance other than ours, I absolutely wanted to avoid that.

Comment on lines +275 to +276
* It is kept in the code for now, under the assumption that somebody
* may still have reasons to keep using the DiscoFeed-based model.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* It is kept in the code for now, under the assumption that somebody
* may still have reasons to keep using the DiscoFeed-based model.
* It is kept in the code for now because the majority of Dataverse
* installations using Shib are likely not using InCommon.

In the release notes we say that if you're not using InCommon you should set dataverse.feature.shibboleth-use-discofeed=true. I'm pretty sure Harvard Dataverse and UNC Dataverse are the only ones using InCommon. All the other shib installations (of which there are many, I think) will operate in this non-InCommon mode (DiscoFeed-mode), as far as I understand.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out/clarifying this. This is totally on me, I asked which case was more common (it was an in-person conversation by the coffee machine, I think) - but I must have misunderstood your answer as the exact opposite of the above. ... It does make far more sense of course, that our use case is in fact fringe. I changed the feature flag etc. accordingly (to an optional dataverse.feature.shibboleth-use-wayfinder=true). Will update the release note and docs momentarily.

@github-actions

This comment has been minimized.

@pdurbin pdurbin removed their assignment May 22, 2025
@cmbz cmbz added the FY25 Sprint 24 FY25 Sprint 24 (2025-05-21 - 2025-06-04) label May 22, 2025
@landreev
Copy link
Contributor Author

I'm going to mention this during standup, but note that I removed the 6.7 milestone from this last week.
At the same time, there was actually some progress - while at DCM, I pinged the Harvard iam group and finally got them to get to complete the InCommon registration.
But this of course is only 50% of the process - as we also need InCommon to grant this sp the status of a "Research & Scholarship" entity, to match the prod. configuration 1:1. In the process of getting that part done now. But unsure of how long that's going to take, hence not pushing for the inclusion in 6.7.

@landreev
Copy link
Contributor Author

As of yesterday, the word I got was that we would get the answer on the R&S application "within 2 business days", i.e. by tomorrow.

@landreev
Copy link
Contributor Author

Oh wow, I haven't heard back from our contacts, but

% curl "https://mdq.incommon.org/entities/https%3A%2F%2Fdataverse-internal.iq.harvard.edu%2Fsp" | grep -i research

        <saml:AttributeValue>http://refeds.org/category/research-and-scholarship</saml:AttributeValue>

This looks very promising. I will update the "how to test" section in preparation for (maybe) finally being able to test and merge this thing.

@cmbz cmbz added the FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) label Jun 19, 2025
@cmbz cmbz added the FY26 Sprint 1 FY26 Sprint 1 (2025-07-02 - 2025-07-16) label Jul 2, 2025
@landreev landreev moved this from In Review 🔎 to In Progress 💻 in IQSS Dataverse Project Jul 15, 2025
@cmbz cmbz added the FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) label Jul 17, 2025
@cmbz cmbz added the FY26 Sprint 3 (2025-07-30 - 2025-08-13) label Jul 31, 2025
Resolved conflicts:
	src/main/java/edu/harvard/iq/dataverse/settings/FeatureFlags.java
issue #11404
@cmbz cmbz added the FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) label Aug 14, 2025
@cmbz cmbz added the FY26 Sprint 5 FY26 Sprint 5 (2025-08-27 - 2025-09-10) label Aug 28, 2025
@landreev
Copy link
Contributor Author

landreev commented Sep 2, 2025

Working on fixing one bug I had reported on demo: redirects not working consistently. I.e., the user gets logged in successfully, but they not redirected to the proper destination page necessarily.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Sep 4, 2025

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:11404-shib-login-mdq
ghcr.io/gdcc/configbaker:11404-shib-login-mdq

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@landreev landreev merged commit f0abe94 into develop Sep 4, 2025
27 of 28 checks passed
@github-project-automation github-project-automation bot moved this from In Progress 💻 to Merged 🚀 in IQSS Dataverse Project Sep 4, 2025
@landreev landreev added this to the 6.8 milestone Sep 4, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 21 FY25 Sprint 21 (2025-04-09 - 2025-04-23) FY25 Sprint 22 FY25 Sprint 22 (2025-04-23 - 2025-05-07) FY25 Sprint 23 FY25 Sprint 23 (2025-05-07 - 2025-05-21) FY25 Sprint 24 FY25 Sprint 24 (2025-05-21 - 2025-06-04) FY25 Sprint 25 FY25 Sprint 25 (2025-06-04 - 2025-06-18) FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) FY26 Sprint 1 FY26 Sprint 1 (2025-07-02 - 2025-07-16) FY26 Sprint 2 FY26 Sprint 2 (2025-07-16 - 2025-07-30) FY26 Sprint 3 (2025-07-30 - 2025-08-13) FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) FY26 Sprint 5 FY26 Sprint 5 (2025-08-27 - 2025-09-10) Size: 50 A percentage of a sprint. 35 hours.

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Refactor the Shibboleth parts of the Login Page to accommodate the InCommon XML feed being discontinued

6 participants