|
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
|
|
|
|
import javax.portlet.ResourceRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
|
|
|
|
import org.gcube.common.portal.GCubePortalConstants;
|
|
|
|
|
import org.gcube.common.portal.PortalContext;
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
@ -17,12 +17,12 @@ import org.gcube.common.storagehub.client.proxies.WorkspaceManagerClient;
|
|
|
|
|
import org.gcube.common.storagehub.model.items.Item;
|
|
|
|
|
import org.gcube.oidc.rest.JWTToken;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.InvalidTokenException;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.JWTTokenUtil;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.MissingTokenException;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.NotAuthorizedException;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.RefreshException;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.UMAException;
|
|
|
|
|
import org.gcube.portal.oidc.lr62.UMATokensProvider;
|
|
|
|
|
import org.gcube.portlets.user.wswidget.shared.AuthorizedUser;
|
|
|
|
|
import org.gcube.portlets.user.wswidget.shared.WSItem;
|
|
|
|
|
|
|
|
|
@ -147,7 +147,7 @@ public class StorageHubServiceUtil {
|
|
|
|
|
try {
|
|
|
|
|
long userId = PortalUtil.getUser(request).getUserId();
|
|
|
|
|
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, userId, currentContext);
|
|
|
|
|
UMATokensProvider.instance.set(umaToken.getRaw());
|
|
|
|
|
AccessTokenProvider.instance.set(JWTTokenUtil.getAccessTokenString(umaToken));
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
e1.printStackTrace();
|
|
|
|
|
}
|
|
|
|
@ -174,7 +174,7 @@ public class StorageHubServiceUtil {
|
|
|
|
|
String username = currentUsername;
|
|
|
|
|
try {
|
|
|
|
|
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, username, currentContext);
|
|
|
|
|
UMATokensProvider.instance.set(umaToken.getRaw());
|
|
|
|
|
AccessTokenProvider.instance.set(JWTTokenUtil.getAccessTokenString(umaToken));
|
|
|
|
|
} catch (InvalidTokenException | MissingTokenException | RefreshException | NotAuthorizedException
|
|
|
|
|
| UMAException e1) {
|
|
|
|
|
_log.warn("could not get UMA Token for context="+currentContext);
|
|
|
|
|