Fixing token generation for clientId

This commit is contained in:
luca.frosini 2023-07-11 10:25:13 +02:00
parent 79b6527057
commit 1199570e57
2 changed files with 7 additions and 3 deletions

View File

@ -156,6 +156,10 @@
<groupId>org.gcube.common</groupId>
<artifactId>gxHTTP</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>keycloak-client</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>

View File

@ -55,9 +55,9 @@ public class Constants {
}
private static TokenResponse getJWTAccessToken() throws Exception {
String contextToAuthorise = SecretManagerProvider.instance.get().getContext();
Entry<String,String> entry = getClientIdAndClientSecret(contextToAuthorise);
TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(contextToAuthorise, entry.getKey(), entry.getValue(), null, null);
String context = SecretManagerProvider.instance.get().getContext();
Entry<String,String> entry = getClientIdAndClientSecret(context);
TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(context, entry.getKey(), entry.getValue(), context, null);
return tr;
}