From 40633c6ed98312b45bd7520292f6185ea4dc91a8 Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Tue, 25 May 2021 18:31:42 +0200 Subject: [PATCH] removed wrong use of token provider --- .../portal/usersaccount/WorkspaceCreateAccountThread.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/portal/usersaccount/WorkspaceCreateAccountThread.java b/src/main/java/org/gcube/portal/usersaccount/WorkspaceCreateAccountThread.java index 9f8c8ab..36bca90 100644 --- a/src/main/java/org/gcube/portal/usersaccount/WorkspaceCreateAccountThread.java +++ b/src/main/java/org/gcube/portal/usersaccount/WorkspaceCreateAccountThread.java @@ -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) {