diff --git a/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java b/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java index c21c1abcc2..df2b0bab36 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/AuthenticationMethod.java @@ -225,17 +225,4 @@ public interface AuthenticationMethod { HttpServletRequest request, HttpServletResponse response); - /** - * Get title of login page to which to redirect. - * Returns a message key that gets translated into the title - * or label for "login page" (or null, if not implemented) This - * title may be used to identify the link to the login page in a - * selection menu, when there are multiple ways to login. - * - * @param context - * DSpace context, will be modified (ePerson set) upon success. - * - * @return title text. - */ - public String loginPageTitle(Context context); } diff --git a/dspace-api/src/main/java/org/dspace/authenticate/IPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/IPAuthentication.java index 5ac947b720..7ca634ee24 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/IPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/IPAuthentication.java @@ -317,9 +317,4 @@ public class IPAuthentication implements AuthenticationMethod return null; } - @Override - public String loginPageTitle(Context context) - { - return null; - } } diff --git a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java index cc352d09d7..5fcc7d1841 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/LDAPAuthentication.java @@ -723,22 +723,6 @@ public class LDAPAuthentication return null; } - /** - * Returns message key for title of the "login" page, to use - * in a menu showing the choice of multiple login methods. - * - * @param context - * DSpace context, will be modified (ePerson set) upon success. - * - * @return Message key to look up in i18n message catalog. - */ - @Override - public String loginPageTitle(Context context) - { - return "org.dspace.eperson.LDAPAuthentication.title"; - } - - /* * Add authenticated users to the group defined in dspace.cfg by * the authentication-ldap.login.groupmap.* key. diff --git a/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java index d71b5f7017..58c3aa8db3 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/PasswordAuthentication.java @@ -275,18 +275,4 @@ public class PasswordAuthentication return null; } - /** - * Returns message key for title of the "login" page, to use - * in a menu showing the choice of multiple login methods. - * - * @param context - * DSpace context, will be modified (EPerson set) upon success. - * - * @return Message key to look up in i18n message catalog. - */ - @Override - public String loginPageTitle(Context context) - { - return "org.dspace.eperson.PasswordAuthentication.title"; - } } diff --git a/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java b/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java index 228d5d06cf..f4d2f8c301 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/ShibAuthentication.java @@ -528,25 +528,6 @@ public class ShibAuthentication implements AuthenticationMethod } } - /** - * Get title of login page to which to redirect. Returns a message - * key that gets translated into the title or label for "login page" (or - * null, if not implemented) This title may be used to identify the link to - * the login page in a selection menu, when there are multiple ways to - * login. - * - * @param context - * DSpace context, will be modified (ePerson set) upon success. - * - * @return title text. - */ - @Override - public String loginPageTitle(Context context) - { - return "org.dspace.authenticate.ShibAuthentication.title"; - } - - /** * Identify an existing EPerson based upon the shibboleth attributes provided on * the request object. There are three cases where this can occurr, each as diff --git a/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java b/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java index 5a6a2019a4..f8b5bc90c2 100644 --- a/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java +++ b/dspace-api/src/main/java/org/dspace/authenticate/X509Authentication.java @@ -686,18 +686,4 @@ public class X509Authentication implements AuthenticationMethod return loginPageURL; } - /** - * Returns message key for title of the "login" page, to use in a menu - * showing the choice of multiple login methods. - * - * @param context - * DSpace context, will be modified (EPerson set) upon success. - * - * @return Message key to look up in i18n message catalog. - */ - @Override - public String loginPageTitle(Context context) - { - return loginPageTitle; - } } diff --git a/dspace-spring-rest/src/main/java/org/dspace/app/rest/AuthenticationRestController.java b/dspace-spring-rest/src/main/java/org/dspace/app/rest/AuthenticationRestController.java index 05cae9babb..2dfe08d1ee 100644 --- a/dspace-spring-rest/src/main/java/org/dspace/app/rest/AuthenticationRestController.java +++ b/dspace-spring-rest/src/main/java/org/dspace/app/rest/AuthenticationRestController.java @@ -94,26 +94,6 @@ public class AuthenticationRestController implements InitializingBean { return getLoginResponse(request, "Authentication failed for user " + user + ": The credentials you provided are not valid."); } - //TODO This should be moved under API, but then we also need to update org.dspace.authenticate.ShibAuthentication - //This is also not gonna work until it is moved - @RequestMapping(value = "/shibboleth-login", method = {RequestMethod.GET, RequestMethod.POST}) - public ResponseEntity shibbolethLogin(HttpServletRequest request) { - //If you can get here, you should be authenticated, the actual login is handled by spring security. - //If not, no valid Shibboleth session is present or Shibboleth config is missing. - - /* Make sure to apply - - AuthType shibboleth - - ShibRequireSession On - - ShibUseHeaders On - - require valid-user - to this endpoint. The Shibboleth daemon will then take care of redirecting you to the login page if - necessary. - */ - - //TODO we should redirect the user to a correct page in the UI. These could be provided as optional parameters. - return getLoginResponse(request, "Shibboleth authentication failed: No valid Shibboleth session could be found."); - } - @RequestMapping(value = "/logout", method = {RequestMethod.GET, RequestMethod.POST}) public ResponseEntity logout() { //This is handled by org.dspace.app.rest.security.CustomLogoutHandler diff --git a/dspace-spring-rest/src/main/java/org/dspace/app/rest/security/WebSecurityConfiguration.java b/dspace-spring-rest/src/main/java/org/dspace/app/rest/security/WebSecurityConfiguration.java index a1d71d0341..3c14d66650 100644 --- a/dspace-spring-rest/src/main/java/org/dspace/app/rest/security/WebSecurityConfiguration.java +++ b/dspace-spring-rest/src/main/java/org/dspace/app/rest/security/WebSecurityConfiguration.java @@ -87,8 +87,6 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { //Add a filter before our login endpoints to do the authentication based on the data in the HTTP request .addFilterBefore(new StatelessLoginFilter("/api/authn/login", authenticationManager(), restAuthenticationService), LogoutFilter.class) - //TODO see comment at org.dspace.app.rest.AuthenticationRestController.shibbolethLogin() - .addFilterBefore(new StatelessLoginFilter("/shibboleth-login", authenticationManager(), restAuthenticationService), LogoutFilter.class) // Add a custom Token based authentication filter based on the token previously given to the client before each URL .addFilterBefore(new StatelessAuthenticationFilter(authenticationManager(), restAuthenticationService,