Skip to content

Commit

Permalink
Comment out SAML auth and reinstate LDAP auth
Browse files Browse the repository at this point in the history
  • Loading branch information
zgary committed Oct 9, 2018
1 parent e9086a2 commit c573c55
Show file tree
Hide file tree
Showing 11 changed files with 430 additions and 346 deletions.
328 changes: 0 additions & 328 deletions dspace-jspui/src/main/webapp/WEB-INF/spring/securityContext.xml

This file was deleted.

62 changes: 46 additions & 16 deletions dspace-jspui/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
<filter-name>rdf-content-negotiation</filter-name>
<filter-class>org.dspace.rdf.negotiation.NegotiationFilter</filter-class>
</filter>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<!--<filter>-->
<!--<filter-name>springSecurityFilterChain</filter-name>-->
<!--<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>-->
<!--</filter>-->

<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--<filter-mapping>-->
<!--<filter-name>springSecurityFilterChain</filter-name>-->
<!--<url-pattern>/*</url-pattern>-->
<!--</filter-mapping>-->

<!-- Filter mappings -->
<filter-mapping>
Expand Down Expand Up @@ -284,6 +284,11 @@
<servlet-class>org.dspace.app.webui.servlet.InternalErrorServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>logout</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.LogoutServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>metadataexport</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.MetadataExportServlet</servlet-class>
Expand Down Expand Up @@ -325,15 +330,25 @@
</servlet>

<servlet>
<servlet-name>saml-login</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.SAMLServlet</servlet-class>
<servlet-name>password-login</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.PasswordServlet</servlet-class>
</servlet>

<servlet>
<servlet-name>saml-logout</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.SAMLLogoutServlet</servlet-class>
<servlet-name>ldap-login</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.LDAPServlet</servlet-class>
</servlet>

<!--<servlet>-->
<!--<servlet-name>saml-login</servlet-name>-->
<!--<servlet-class>org.dspace.app.webui.servlet.SAMLServlet</servlet-class>-->
<!--</servlet>-->

<!--<servlet>-->
<!--<servlet-name>saml-logout</servlet-name>-->
<!--<servlet-class>org.dspace.app.webui.servlet.SAMLLogoutServlet</servlet-class>-->
<!--</servlet>-->

<servlet>
<servlet-name>profile</servlet-name>
<servlet-class>org.dspace.app.webui.servlet.EditProfileServlet</servlet-class>
Expand Down Expand Up @@ -606,6 +621,11 @@
<url-pattern>/internal-error</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>logout</servlet-name>
<url-pattern>/logout</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>metadataexport</servlet-name>
<url-pattern>/dspace-admin/metadataexport</url-pattern>
Expand Down Expand Up @@ -647,14 +667,24 @@
</servlet-mapping>

<servlet-mapping>
<servlet-name>saml-login</servlet-name>
<url-pattern>/saml-login</url-pattern>
<servlet-name>password-login</servlet-name>
<url-pattern>/password-login</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>saml-logout</servlet-name>
<url-pattern>/saml-logout</url-pattern>
<servlet-name>ldap-login</servlet-name>
<url-pattern>/ldap-login</url-pattern>
</servlet-mapping>

<!--<servlet-mapping>-->
<!--<servlet-name>saml-login</servlet-name>-->
<!--<url-pattern>/saml-login</url-pattern>-->
<!--</servlet-mapping>-->

<!--<servlet-mapping>-->
<!--<servlet-name>saml-logout</servlet-name>-->
<!--<url-pattern>/saml-logout</url-pattern>-->
<!--</servlet-mapping>-->

<servlet-mapping>
<servlet-name>profile</servlet-name>
Expand Down
2 changes: 1 addition & 1 deletion dspace-jspui/src/main/webapp/layout/header-default.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<%-- HACK: marginwidth, marginheight: for non-CSS compliant Netscape browser --%>
<body class="undernavigation">
<a class="sr-only" href="#content">Skip navigation</a>
<dspace:include page="/layout/header-nyc.jsp" />
<%--<dspace:include page="/layout/header-nyc.jsp" />--%>
<header class="navbar navbar-inverse">
<%
if (!navbar.equals("off"))
Expand Down
2 changes: 1 addition & 1 deletion dspace-jspui/src/main/webapp/layout/header-submission.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<%-- HACK: marginwidth, marginheight: for non-CSS compliant Netscape browser --%>
<body class="undernavigation">
<a class="sr-only" href="#content">Skip navigation</a>
<dspace:include page="/layout/header-nyc.jsp" />
<%--<dspace:include page="/layout/header-nyc.jsp" />--%>
<header class="navbar navbar-inverse">
<%
if (!navbar.equals("off"))
Expand Down
38 changes: 38 additions & 0 deletions dspace-jspui/src/main/webapp/login/ldap-incorrect.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<%--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
--%>
<%--
- Display message indicating password is incorrect, and allow a retry
--%>

<%@ page contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>

<dspace:layout navbar="off"
locbar="nolink"
titlekey="jsp.login.ldap-incorrect.title">
<table border="0" width="90%">
<tr>
<td align="left">
<h1><fmt:message key="jsp.login.ldap-incorrect.heading"/></h1>
</td>
<td align="right" class="standard">
<dspace:popup page="<%= LocaleSupport.getLocalizedMessage(pageContext, \"help.index\") + \"#login\" %>"><fmt:message key="jsp.help"/></dspace:popup>
</td>
</tr>
</table>
<p align="center"><strong><fmt:message key="jsp.login.ldap-incorrect.errormsg"/></strong></p>
<dspace:include page="/components/ldap-form.jsp" />
</dspace:layout>
37 changes: 37 additions & 0 deletions dspace-jspui/src/main/webapp/login/ldap.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<%--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
--%>
<%--
- Page that displays the netid/password login form
--%>

<%@ page contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>

<dspace:layout navbar="off"
locbar="off"
titlekey="jsp.login.ldap.title">

<table border="0" width="90%">
<tr>
<td align="left">
<h1><fmt:message key="jsp.login.ldap.heading"/></h1>
</td>
<td align="right" class="standard">
<dspace:popup page="<%= LocaleSupport.getLocalizedMessage(pageContext, \"help.index\") + \"#login\"%>"><fmt:message key="jsp.help"/></dspace:popup>
</td>
</tr>
</table>
<dspace:include page="/components/ldap-form.jsp" />
</dspace:layout>
30 changes: 30 additions & 0 deletions dspace-jspui/src/main/webapp/login/logged-out.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<%--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
--%>
<%--
- Displays a message indicating the user has logged out
--%>

<%@ page contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"
prefix="fmt" %>

<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>

<dspace:layout locbar="nolink" titlekey="jsp.login.logged-out.title">
<%-- <h1>Logged Out</h1> --%>
<h1><fmt:message key="jsp.login.logged-out.title"/></h1>

<%-- <p>Thank you for remembering to log out!</p> --%>
<p><fmt:message key="jsp.login.logged-out.thank"/></p>
<%-- <p><a href="<%= request.getContextPath() %>/">Go to DSpace Home</a></p> --%>
<p><a href="<%= request.getContextPath() %>/"><fmt:message key="jsp.general.gohome"/></a></p>

</dspace:layout>
29 changes: 29 additions & 0 deletions dspace-jspui/src/main/webapp/login/password.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<%--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
--%>
<%--
- Page that displays the email/password login form
--%>

<%@ page contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>

<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>

<dspace:layout navbar="default" locbar="off" titlekey="jsp.login.password.title" nocache="true">
<div class="panel panel-primary">
<div class="panel-heading"><fmt:message key="jsp.login.password.heading"/>
<span class="pull-right"><dspace:popup page="<%= LocaleSupport.getLocalizedMessage(pageContext, \"help.index\") + \"#login\"%>"><fmt:message key="jsp.help"/></dspace:popup></span>
</div>
<dspace:include page="/components/login-form.jsp" />
</div>
</dspace:layout>
95 changes: 95 additions & 0 deletions dspace-jspui/src/main/webapp/register/edit-profile.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<%--
The contents of this file are subject to the license and copyright
detailed in the LICENSE and NOTICE files at the root of the source
tree and available online at
http://www.dspace.org/license/
--%>
<%--
- Profile editing page
-
- Attributes to pass in:
-
- eperson - the EPerson who's editing their profile
- missing.fields - if a Boolean true, the user hasn't entered enough
- information on the form during a previous attempt
- password.problem - if a Boolean true, there's a problem with password
--%>

<%@ page contentType="text/html;charset=UTF-8" %>

<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"
prefix="fmt" %>


<%@ taglib uri="http://www.dspace.org/dspace-tags.tld" prefix="dspace" %>

<%@ page import="javax.servlet.jsp.jstl.fmt.LocaleSupport" %>

<%@ page import="org.dspace.eperson.EPerson, org.dspace.core.ConfigurationManager" %>
<%@ page import="org.dspace.core.Utils" %>

<%
EPerson eperson = (EPerson) request.getAttribute("eperson");
Boolean attr = (Boolean) request.getAttribute("missing.fields");
boolean missingFields = (attr != null && attr.booleanValue());
attr = (Boolean) request.getAttribute("password.problem");
boolean passwordProblem = (attr != null && attr.booleanValue());
boolean ldap_enabled = ConfigurationManager.getBooleanProperty("authentication-ldap", "enable");
boolean ldap_eperson = (ldap_enabled && (eperson.getNetid() != null) && (eperson.getNetid().equals("") == false));
%>

<dspace:layout style="submission" titlekey="jsp.register.edit-profile.title" nocache="true">

<%-- <h1>Edit Your Profile</h1> --%>
<h1><fmt:message key="jsp.register.edit-profile.title"/>
<dspace:popup page='<%= LocaleSupport.getLocalizedMessage(pageContext, "help.index") + "#editprofile"%>'><fmt:message key="jsp.morehelp"/></dspace:popup>
</h1>

<%
if (missingFields)
{
%>
<%-- <p><strong>Please fill out all of the required fields.</strong></p> --%>
<p class="alert alert-info"><fmt:message key="jsp.register.edit-profile.info1"/></p>
<%
}
if (passwordProblem)
{
%>
<%-- <p><strong>The passwords you enter below must match, and need to be at
least 6 characters long.</strong></p> --%>
<p class="alert alert-warning"><fmt:message key="jsp.register.edit-profile.info2"/></p>
<%
}
%>

<div class="alert alert-info"><fmt:message key="jsp.register.edit-profile.info3"/></div>

<form class="form-horizontal" action="<%= request.getContextPath() %>/profile" method="post">

<dspace:include page="/register/profile-form.jsp" />
<input type="hidden" name="csrf_token" value="<%=session.getAttribute("csrfToken")%>">

<%
// Only show password update section if the user doesn't use
// certificates
if ((eperson.getRequireCertificate() == false) && (ldap_eperson == false))
{
%>
<p class="alert" style="padding-bottom: 0px; text-align: center;"><fmt:message key="jsp.register.edit-profile.info5"/></p>
<%
}
%>
<div class="col-md-offset-5">
<%-- <p align="center"><input type="submit" name="submit" value="Update Profile"></p> --%>
<input class="btn btn-success col-md-4" type="submit" name="submit" value="<fmt:message key="jsp.register.edit-profile.update.button"/>" />
</div>
</form>
</dspace:layout>
Loading

0 comments on commit c573c55

Please sign in to comment.