diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
index 07d3f48..70af32e 100644
--- a/.settings/org.eclipse.wst.common.component
+++ b/.settings/org.eclipse.wst.common.component
@@ -677,9 +677,6 @@
-
- uses
-
uses
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b879504..75381e7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Provided the "Export as PDF" facility [#26026]
- Integrated the GeoportalExporter as service [#27321]
+- Passed to the new KC-client [#27398]
## [v3.6.0]
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalExporterActionServlet.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalExporterActionServlet.java
index c6420ca..7a94346 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalExporterActionServlet.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/GeoportalExporterActionServlet.java
@@ -57,6 +57,17 @@ public class GeoportalExporterActionServlet extends HttpServlet {
* @throws ServletException the servlet exception
*/
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException {
+ serveRequest(req, resp);
+ }
+
+ /**
+ * Serve request.
+ *
+ * @param req the req
+ * @param resp the resp
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ public void serveRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException {
// setSecretManager();
String projectID = req.getParameter(GeoportalDataViewerConstants.PROIECT_ID_PARAMETER);
String ucdID = req.getParameter(GeoportalDataViewerConstants.UCD_ID_PARAMETER);
@@ -73,7 +84,7 @@ public class GeoportalExporterActionServlet extends HttpServlet {
logger.info("The scope is {}", scope);
try {
- //Setting header required to {@PortalContext}
+ // 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, userID);
@@ -86,7 +97,7 @@ public class GeoportalExporterActionServlet extends HttpServlet {
GeoportalExporterAPI geoportalExporterAPI = new GeoportalExporterAPI();
URL urlRequest = geoportalExporterAPI.exportProject("pdf", ucdID, projectID, false);
String urlToRedirect = urlRequest.toString();
- logger.info("Performing request to {} with identity {}", urlToRedirect, identity.getDescription());
+ logger.info("Performing request to {} with identity description {}", urlToRedirect, identity.getDescription());
logger.info("Token is {}", theToken.substring(0, 20) + "_MASKED_TOKEN");
InputStream is = performHttpRequestToSGService(urlToRedirect, theIdentity, theToken);
@@ -99,9 +110,17 @@ public class GeoportalExporterActionServlet extends HttpServlet {
sendError(resp, "Error occurred when exporting the Project. Error is: " + e.getMessage());
return;
}
-
}
+ /**
+ * Perform http request to SG service.
+ *
+ * @param urlToService the url to service
+ * @param identity the identity
+ * @param token the token
+ * @return the input stream
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
public static InputStream performHttpRequestToSGService(String urlToService, String identity, String token)
throws IOException {
logger.debug("performHttpRequestToSGService called");
diff --git a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/mongoservice/accessidentity/IAMClientIdentity.java b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/mongoservice/accessidentity/IAMClientIdentity.java
index 2239279..39b577b 100644
--- a/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/mongoservice/accessidentity/IAMClientIdentity.java
+++ b/src/main/java/org/gcube/portlets/user/geoportaldataviewer/server/mongoservice/accessidentity/IAMClientIdentity.java
@@ -46,8 +46,9 @@ public class IAMClientIdentity implements GcubeIdentity {
try {
LOG.info("Querying KeycloakClientFactory to get UMA token..");
- TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(clientId, clientSecret, currentScope,
+ TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(currentScope, clientId, clientSecret, currentScope,
null);
+
umaAcessToken = tr.getAccessToken();
if (umaAcessToken != null && !umaAcessToken.isEmpty()) {
LOG.info("UMA Access Token read correctly");