removed wrong use of token provider

This commit is contained in:
Massimiliano Assante 2021-05-25 18:31:42 +02:00
parent e82dfa44d1
commit 40633c6ed9
1 changed files with 4 additions and 4 deletions

View File

@ -2,6 +2,7 @@ package org.gcube.portal.usersaccount;
import java.util.ArrayList;
import java.util.List;
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import static org.gcube.common.authorization.client.Constants.authorizationService;
@ -10,7 +11,6 @@ import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
import org.gcube.common.storagehub.model.exceptions.UserNotAuthorizedException;
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
import org.gcube.portal.oidc.lr62.UMATokensProvider;
import org.gcube.vomanagement.usermanagement.RoleManager;
import org.gcube.vomanagement.usermanagement.UserManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
@ -44,7 +44,7 @@ public class WorkspaceCreateAccountThread implements Runnable {
SecurityTokenProvider.instance.set(authorizationToken);
ScopeProvider.instance.set(context);
String previousToken = authorizationToken;
String previousUMAToken = UMATokensProvider.instance.get();
String previousUMAToken = AccessTokenProvider.instance.get();
try {
//get the super user
String infraContext = "/"+PortalContext.getConfiguration().getInfrastructureName();
@ -83,12 +83,12 @@ public class WorkspaceCreateAccountThread implements Runnable {
shc = new StorageHubClient();
shc.createUserAccount(currentUsername);
SecurityTokenProvider.instance.set(previousToken);
UMATokensProvider.instance.set(previousUMAToken);
AccessTokenProvider.instance.set(previousUMAToken);
_log.info("shub.createUserAccount performed for "+username + " with super mega admin (Hopefully)");
}
_log.debug("shub.createUserAccount completed for "+username);
SecurityTokenProvider.instance.set(previousToken);
UMATokensProvider.instance.set(previousUMAToken);
AccessTokenProvider.instance.set(previousUMAToken);
}
}
catch (Exception e) {