Skip to content

Commit

Permalink
merge Implement the Shibboleth login changes that are needed for Data…
Browse files Browse the repository at this point in the history
…verseNL
  • Loading branch information
qqmyers authored and PaulBoon committed Oct 3, 2024
1 parent 6ce3a61 commit 81e911f
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 3 deletions.
14 changes: 12 additions & 2 deletions src/main/java/edu/harvard/iq/dataverse/SettingsWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/edu/harvard/iq/dataverse/util/SystemConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 28 additions & 1 deletion src/main/webapp/loginpage.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,34 @@
</h:outputFormat>
</p>
</h:form>

<!-- DANS Shib login without discofeed; idpselect is not done here! - Start -->
<div jsf:rendered="#{!settingsWrapper.shibIdpSelectEnabled}">
<div class="form-horizontal">
<div class="form-group text-left">
<div class="col-sm-12" >
<form action="/Shibboleth.sso/Login" method="POST" autocomplete="OFF" class="form-inline">
<input type="hidden" name="SAMLDS" value="1"/>
<input name="target" value="#{systemConfig.dataverseSiteUrl}/shib.xhtml" type="hidden"/>
<!-- <div class="IdPSelectTextDiv help-block"></div> -->
<div class="form-group">
<div class="col-sm-9 button-block">
<button id="login" name="login" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only btn btn-default" onclick="return true;" type="submit" role="button" aria-disabled="false">
<!-- <span class="ui-button-text ui-c text-nowrap">#{bundle['login.institution']}</span> -->
<!-- #{bundle['login.institution']} used to be 'Institutional Login' -->
<span class="ui-button-text ui-c text-nowrap">
<h:outputText value="#{LoginPage.getLoginButtonText()}"/>
</span>
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- DANS Shib login without discofeed - End -->
<div jsf:rendered="#{settingsWrapper.shibIdpSelectEnabled}">
<div class="form-horizontal" >
<div class="form-group text-left">
<label class="col-sm-4 control-label">
#{bundle['auth.providers.title.shib']}
Expand Down Expand Up @@ -162,6 +188,7 @@
<script src="/resources/js/shib/idpselect.js"></script>
<script src="/resources/js/shib/idpselect_style.js"></script>
</div>
</div>

<!--ONLY RENDER BUTTON FOR OAUTH PROVIDERS (ORCID, Google, GitHub)-->
<div class="form-horizontal" jsf:rendered="#{LoginPage.authProvider.OAuthProvider}">
Expand Down

0 comments on commit 81e911f

Please sign in to comment.