mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-10 19:43:10 +00:00
Handle redirect to client after shibboleth authentication succeded
This commit is contained in:
@@ -33,6 +33,7 @@ import org.dspace.content.NonUniqueMetadataException;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.MetadataFieldService;
|
||||
import org.dspace.content.service.MetadataSchemaService;
|
||||
import org.dspace.core.ConfigurationManager;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.eperson.EPerson;
|
||||
import org.dspace.eperson.Group;
|
||||
@@ -509,18 +510,8 @@ public class ShibAuthentication implements AuthenticationMethod {
|
||||
int port = request.getServerPort();
|
||||
String contextPath = request.getContextPath();
|
||||
|
||||
String returnURL = request.getHeader("Referer");
|
||||
if (returnURL == null) {
|
||||
if (request.isSecure() || forceHTTPS) {
|
||||
returnURL = "https://";
|
||||
} else {
|
||||
returnURL = "http://";
|
||||
}
|
||||
returnURL += host;
|
||||
if (!(port == 443 || port == 80)) {
|
||||
returnURL += ":" + port;
|
||||
}
|
||||
}
|
||||
String returnURL = ConfigurationManager.getProperty("dspace.baseUrl") + "/api/authn/shibboleth?redirectUrl="
|
||||
+ request.getHeader("Referer");
|
||||
|
||||
try {
|
||||
shibURL += "?target=" + URLEncoder.encode(returnURL, "UTF-8");
|
||||
|
Reference in New Issue
Block a user