setting USER_ID_ATTR_NAME

This commit is contained in:
Francesco Mangiacrapa 2024-04-29 16:43:34 +02:00
parent 7d4e363c9f
commit 528c82cae5
1 changed files with 4 additions and 1 deletions

View File

@ -64,6 +64,9 @@ public class GeoportalExporterActionServlet extends HttpServlet {
String userID = req.getParameter(GeoportalDataViewerConstants.USER_ID_PARAMETER);
logger.info("doGet called with [projectID: " + projectID + ", ucdID: " + ucdID + ", contextID: " + contextID
+ ", userID: " + userID + "]");
System.out.println("doGet called with [projectID: " + projectID + ", ucdID: " + ucdID + ", contextID: " + contextID
+ ", userID: " + userID + "]");
if (contextID == null || contextID.isEmpty())
sendError(resp, "Bad Request. No context found!");
@ -76,7 +79,7 @@ public class GeoportalExporterActionServlet extends HttpServlet {
//Setting header required to {@PortalContext}
MutableHttpServletRequest mutableRequest = new MutableHttpServletRequest(req);
mutableRequest.putHeader(PortalContext.VRE_ID_ATTR_NAME, contextID);
// mutableRequest.putHeader(PortalContext.USER_ID_ATTR_NAME, contextID);
mutableRequest.putHeader(PortalContext.USER_ID_ATTR_NAME, userID);
ScopeProvider.instance.set(scope);
GeoportalServiceIdentityProxy identity = new GeoportalServiceIdentityProxy(mutableRequest);
String theToken = identity.getToken();