From 81e911f1601d192d25e5715bf79b76ee5321fc83 Mon Sep 17 00:00:00 2001 From: qqmyers Date: Wed, 26 Jun 2024 09:43:26 -0400 Subject: [PATCH] merge Implement the Shibboleth login changes that are needed for DataverseNL --- .../harvard/iq/dataverse/SettingsWrapper.java | 14 +++++++-- .../settings/SettingsServiceBean.java | 4 +++ .../iq/dataverse/util/SystemConfig.java | 5 ++++ src/main/webapp/loginpage.xhtml | 29 ++++++++++++++++++- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java index 48196591b19..448f87e7585 100644 --- a/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java +++ b/src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java @@ -92,7 +92,10 @@ public class SettingsWrapper implements java.io.Serializable { private String appVersionWithBuildNumber = null; private Boolean shibPassiveLoginEnabled = null; - + + // DANS Shib login without discofeed + private Boolean shibIdpSelectEnabled = null; + private String footerCopyrightAndYear = null; //External Vocabulary support @@ -781,7 +784,14 @@ public boolean isShibPassiveLoginEnabled() { } return shibPassiveLoginEnabled; } - + // DANS Shib login without discofeed + public boolean isShibIdpSelectEnabled() { + if (shibIdpSelectEnabled == null) { + shibIdpSelectEnabled = systemConfig.isShibIdpSelectEnabled(); + } + return shibIdpSelectEnabled; + } + // Caching this result may not be saving much, *currently* (since the value is // stored in the bundle). -- L.A. 5.8 public String getFooterCopyrightAndYear() { diff --git a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java index 8ed96690e84..d5730530ebb 100644 --- a/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java +++ b/src/main/java/edu/harvard/iq/dataverse/settings/SettingsServiceBean.java @@ -502,6 +502,10 @@ Whether Harvesting (OAI) service is enabled *Split the affiliation array on given string, default ";" */ ShibAffiliationSeparator, + /** + * Get list of providers from discofeed and provide selection for login within Dataverse, default true + */ + ShibIdpSelectEnabled, /** * Validate physical files for all the datafiles in the dataset when publishing */ diff --git a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java index f9801419e47..b930cf71e55 100644 --- a/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java +++ b/src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java @@ -614,6 +614,11 @@ public boolean isShibAttributeCharacterSetConversionEnabled() { boolean defaultResponse = true; return settingsService.isTrueForKey(SettingsServiceBean.Key.ShibAttributeCharacterSetConversionEnabled, defaultResponse); } + // DANS Shib login without discofeed + public boolean isShibIdpSelectEnabled() { + boolean defaultResponse = true; + return settingsService.isTrueForKey(SettingsServiceBean.Key.ShibIdpSelectEnabled, defaultResponse); + } /** * getPVDictionaries diff --git a/src/main/webapp/loginpage.xhtml b/src/main/webapp/loginpage.xhtml index e1b77e9583b..a825fa95dd5 100644 --- a/src/main/webapp/loginpage.xhtml +++ b/src/main/webapp/loginpage.xhtml @@ -120,8 +120,34 @@

- + +
+
+
+
+ + + +
+
+ +
+
+
+
+
+
+
+ +
+
+