mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 19:43:10 +00:00
remove methods that are not applicable
This commit is contained in:
@@ -225,17 +225,4 @@ public interface AuthenticationMethod {
|
|||||||
HttpServletRequest request,
|
HttpServletRequest request,
|
||||||
HttpServletResponse response);
|
HttpServletResponse response);
|
||||||
|
|
||||||
/**
|
|
||||||
* Get title of login page to which to redirect.
|
|
||||||
* Returns a <i>message key</i> 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);
|
|
||||||
}
|
}
|
||||||
|
@@ -317,9 +317,4 @@ public class IPAuthentication implements AuthenticationMethod
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String loginPageTitle(Context context)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -723,22 +723,6 @@ public class LDAPAuthentication
|
|||||||
return null;
|
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
|
* Add authenticated users to the group defined in dspace.cfg by
|
||||||
* the authentication-ldap.login.groupmap.* key.
|
* the authentication-ldap.login.groupmap.* key.
|
||||||
|
@@ -275,18 +275,4 @@ public class PasswordAuthentication
|
|||||||
return null;
|
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";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -528,25 +528,6 @@ public class ShibAuthentication implements AuthenticationMethod
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get title of login page to which to redirect. Returns a <i>message
|
|
||||||
* key</i> 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
|
* Identify an existing EPerson based upon the shibboleth attributes provided on
|
||||||
* the request object. There are three cases where this can occurr, each as
|
* the request object. There are three cases where this can occurr, each as
|
||||||
|
@@ -686,18 +686,4 @@ public class X509Authentication implements AuthenticationMethod
|
|||||||
return loginPageURL;
|
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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -94,26 +94,6 @@ public class AuthenticationRestController implements InitializingBean {
|
|||||||
return getLoginResponse(request, "Authentication failed for user " + user + ": The credentials you provided are not valid.");
|
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})
|
@RequestMapping(value = "/logout", method = {RequestMethod.GET, RequestMethod.POST})
|
||||||
public ResponseEntity logout() {
|
public ResponseEntity logout() {
|
||||||
//This is handled by org.dspace.app.rest.security.CustomLogoutHandler
|
//This is handled by org.dspace.app.rest.security.CustomLogoutHandler
|
||||||
|
@@ -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
|
//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)
|
.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
|
// Add a custom Token based authentication filter based on the token previously given to the client before each URL
|
||||||
.addFilterBefore(new StatelessAuthenticationFilter(authenticationManager(), restAuthenticationService,
|
.addFilterBefore(new StatelessAuthenticationFilter(authenticationManager(), restAuthenticationService,
|
||||||
|
Reference in New Issue
Block a user