diff --git a/CHANGELOG.md b/CHANGELOG.md
index 24583d0..1c4c6e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,7 +2,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
# Changelog for gCube Catalogue (gCat) Service
-## [v2.2.0]
+## [v2.2.0-SNAPSHOT]
- Switched gcat credentials to new IAM authz [#21628][#22727]
- Added support to manage configurations [#22658][#22742]
diff --git a/pom.xml b/pom.xml
index 78ccd48..457ce8d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.gcube.data-catalogue
gcat
war
- 2.2.0
+ 2.2.0-SNAPSHOT
gCube Catalogue (gCat) Service
This service allows any client to publish on the gCube Catalogue.
@@ -72,7 +72,6 @@
org.gcube.common
authorization-utils
- [2.0.0, 3.0.0-SNAPSHOT)
org.gcube.common
diff --git a/src/main/java/org/gcube/gcat/social/SocialMessage.java b/src/main/java/org/gcube/gcat/social/SocialMessage.java
index eaa7c4a..6253eb4 100644
--- a/src/main/java/org/gcube/gcat/social/SocialMessage.java
+++ b/src/main/java/org/gcube/gcat/social/SocialMessage.java
@@ -33,11 +33,15 @@ public class SocialMessage extends Thread {
protected final ObjectMapper objectMapper;
+ private final String token;
+
protected Message message;
public SocialMessage() throws Exception {
super();
this.objectMapper = new ObjectMapper();
+ SecretManager secretManager = SecretManagerProvider.instance.get();
+ this.token = secretManager.getCurrentSecretHolder().getSecrets().first().getToken();
}
public Message getMessage() {
@@ -76,8 +80,7 @@ public class SocialMessage extends Thread {
GXHTTPStringRequest gxhttpStringRequest = GXHTTPStringRequest.newRequest(basePath);
gxhttpStringRequest.from(Constants.CATALOGUE_NAME);
gxhttpStringRequest.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- SecretManager secretManager = SecretManagerProvider.instance.get();
- gxhttpStringRequest.setSecurityToken(secretManager.getCurrentSecretHolder().getSecrets().first().getToken());
+ gxhttpStringRequest.setSecurityToken(token);
gxhttpStringRequest.path(SOCIAL_SERVICE_SEND_MESSAGE_PATH);
HttpURLConnection httpURLConnection = gxhttpStringRequest.post(messageString);