replaced wrong token provider
This commit is contained in:
parent
0742da7597
commit
99c422f26a
|
@ -2,11 +2,11 @@ package org.gcube.portal.plugins;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||
import org.gcube.common.storagehub.client.dsl.Util;
|
||||
import org.gcube.common.storagehub.client.dsl.VREFolderManager;
|
||||
import org.gcube.portal.oidc.lr62.UMATokensProvider;
|
||||
import org.gcube.portal.plugins.util.AuthUtil;
|
||||
import org.gcube.vomanagement.usermanagement.GroupManager;
|
||||
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
|
||||
|
@ -64,7 +64,7 @@ public class GCubeHookSiteRoleLocalService extends UserGroupRoleLocalServiceWrap
|
|||
|
||||
private void setVREFolderAdministrator(long userId, long groupId, boolean enable) throws Exception {
|
||||
String previousToken = SecurityTokenProvider.instance.get();
|
||||
String previousUMAToken = UMATokensProvider.instance.get();
|
||||
String previousUMAToken = AccessTokenProvider.instance.get();
|
||||
//this put the necessary auth tokens (legacy e UMA) in ThreadLocal
|
||||
AuthUtil.setInfraManagerLegacyAndUMATokenInThreadLocal();
|
||||
String context = gm.getInfrastructureScope(groupId);
|
||||
|
@ -81,7 +81,7 @@ public class GCubeHookSiteRoleLocalService extends UserGroupRoleLocalServiceWrap
|
|||
vreFolderManager.removeAdmin(theUserToPromoteOrDeclass);
|
||||
_log.info("*VREFolder-Hook** add/remove role operation complete");
|
||||
|
||||
UMATokensProvider.instance.set(previousUMAToken);
|
||||
AccessTokenProvider.instance.set(previousUMAToken);
|
||||
SecurityTokenProvider.instance.set(previousToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package org.gcube.portal.plugins;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.storagehub.client.plugins.AbstractPlugin;
|
||||
import org.gcube.common.storagehub.client.proxies.GroupManagerClient;
|
||||
import org.gcube.portal.oidc.lr62.UMATokensProvider;
|
||||
import org.gcube.portal.plugins.thread.CheckShareLatexUserThread;
|
||||
import org.gcube.portal.plugins.thread.RemoveUserTokenFromVREThread;
|
||||
import org.gcube.portal.plugins.util.AuthUtil;
|
||||
|
@ -150,7 +150,7 @@ public class GCubeHookUserLocalService extends UserLocalServiceWrapper {
|
|||
*/
|
||||
private boolean setUser2VREFolder(GroupManager gm, UserManager uMan, String username2Add, String context, boolean add) throws Exception {
|
||||
String previousToken = SecurityTokenProvider.instance.get();
|
||||
String previousUMAToken = UMATokensProvider.instance.get();
|
||||
String previousUMAToken = AccessTokenProvider.instance.get();
|
||||
AuthUtil.setInfraManagerLegacyAndUMATokenInThreadLocal();
|
||||
_log.info("\n*VREFolder-Hook** new authorizationService PortalClient UMA-Token In ThreadLocal done ****\n\n");
|
||||
String vreFolderNameForsHub = getVREFolderNameFromContext(context);
|
||||
|
@ -161,7 +161,7 @@ public class GCubeHookUserLocalService extends UserLocalServiceWrapper {
|
|||
client.removeUserFromGroup(username2Add, vreFolderNameForsHub);
|
||||
|
||||
_log.info("*VREFolder-Hook** " + username2Add + " was added or removed succefully from this VRE Folder. Added? (if false was removed)" + add);
|
||||
UMATokensProvider.instance.set(previousUMAToken);
|
||||
AccessTokenProvider.instance.set(previousUMAToken);
|
||||
SecurityTokenProvider.instance.set(previousToken);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue