mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Rename ShibbolethAuthenticationFilter to ShibbolethLoginFilter
This commit is contained in:
@@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dspace.app.rest.model.AuthnRest;
|
import org.dspace.app.rest.model.AuthnRest;
|
||||||
|
import org.dspace.app.rest.security.ShibbolethLoginFilter;
|
||||||
import org.dspace.authenticate.ShibAuthentication;
|
import org.dspace.authenticate.ShibAuthentication;
|
||||||
import org.dspace.core.Utils;
|
import org.dspace.core.Utils;
|
||||||
import org.dspace.services.ConfigurationService;
|
import org.dspace.services.ConfigurationService;
|
||||||
@@ -38,7 +39,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* 3. User logs in using Shibboleth
|
* 3. User logs in using Shibboleth
|
||||||
* 4. If successful, they are redirected by Shibboleth to this Controller (the path of this controller is passed
|
* 4. If successful, they are redirected by Shibboleth to this Controller (the path of this controller is passed
|
||||||
* to Shibboleth as a URL param in step 1)
|
* to Shibboleth as a URL param in step 1)
|
||||||
* 5. NOTE: Prior to hitting this Controller, {@link org.dspace.app.rest.security.ShibbolethAuthenticationFilter}
|
* 5. NOTE: Prior to hitting this Controller, {@link ShibbolethLoginFilter}
|
||||||
* briefly intercepts the request in order to check for a valid Shibboleth login (see
|
* briefly intercepts the request in order to check for a valid Shibboleth login (see
|
||||||
* ShibAuthentication.authenticate()) and store that user info in a JWT.
|
* ShibAuthentication.authenticate()) and store that user info in a JWT.
|
||||||
* 6. This Controller then gets the request & looks for a "redirectUrl" param (also a part of the original URL from
|
* 6. This Controller then gets the request & looks for a "redirectUrl" param (also a part of the original URL from
|
||||||
@@ -48,7 +49,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
* @author Andrea Bollini (andrea dot bollini at 4science dot it)
|
* @author Andrea Bollini (andrea dot bollini at 4science dot it)
|
||||||
* @author Giuseppe Digilio (giuseppe dot digilio at 4science dot it)
|
* @author Giuseppe Digilio (giuseppe dot digilio at 4science dot it)
|
||||||
* @see ShibAuthentication
|
* @see ShibAuthentication
|
||||||
* @see org.dspace.app.rest.security.ShibbolethAuthenticationFilter
|
* @see ShibbolethLoginFilter
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = "/api/" + AuthnRest.CATEGORY + "/shibboleth")
|
@RequestMapping(value = "/api/" + AuthnRest.CATEGORY + "/shibboleth")
|
||||||
@RestController
|
@RestController
|
||||||
|
@@ -13,6 +13,8 @@ import javax.servlet.ServletException;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.dspace.authenticate.ShibAuthentication;
|
import org.dspace.authenticate.ShibAuthentication;
|
||||||
import org.springframework.security.authentication.AuthenticationManager;
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
import org.springframework.security.authentication.ProviderNotFoundException;
|
import org.springframework.security.authentication.ProviderNotFoundException;
|
||||||
@@ -29,9 +31,10 @@ import org.springframework.security.core.AuthenticationException;
|
|||||||
* @see org.dspace.app.rest.ShibbolethRestController
|
* @see org.dspace.app.rest.ShibbolethRestController
|
||||||
* @see org.dspace.authenticate.ShibAuthentication
|
* @see org.dspace.authenticate.ShibAuthentication
|
||||||
*/
|
*/
|
||||||
public class ShibbolethAuthenticationFilter extends StatelessLoginFilter {
|
public class ShibbolethLoginFilter extends StatelessLoginFilter {
|
||||||
|
private static final Logger log = LogManager.getLogger(ShibbolethLoginFilter.class);
|
||||||
|
|
||||||
public ShibbolethAuthenticationFilter(String url, AuthenticationManager authenticationManager,
|
public ShibbolethLoginFilter(String url, AuthenticationManager authenticationManager,
|
||||||
RestAuthenticationService restAuthenticationService) {
|
RestAuthenticationService restAuthenticationService) {
|
||||||
super(url, authenticationManager, restAuthenticationService);
|
super(url, authenticationManager, restAuthenticationService);
|
||||||
}
|
}
|
@@ -134,7 +134,7 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
|
|||||||
LogoutFilter.class)
|
LogoutFilter.class)
|
||||||
// Add a filter before our shibboleth endpoints to do the authentication based on the data in the
|
// Add a filter before our shibboleth endpoints to do the authentication based on the data in the
|
||||||
// HTTP request
|
// HTTP request
|
||||||
.addFilterBefore(new ShibbolethAuthenticationFilter("/api/authn/shibboleth", authenticationManager(),
|
.addFilterBefore(new ShibbolethLoginFilter("/api/authn/shibboleth", authenticationManager(),
|
||||||
restAuthenticationService),
|
restAuthenticationService),
|
||||||
LogoutFilter.class)
|
LogoutFilter.class)
|
||||||
// Add a custom Token based authentication filter based on the token previously given to the client
|
// Add a custom Token based authentication filter based on the token previously given to the client
|
||||||
|
Reference in New Issue
Block a user