updated use of wrong token provider
This commit is contained in:
parent
b9e4aea1db
commit
9890dfe01c
|
@ -7,7 +7,7 @@ import java.util.List;
|
||||||
import javax.portlet.ResourceRequest;
|
import javax.portlet.ResourceRequest;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||||
import org.gcube.common.portal.GCubePortalConstants;
|
import org.gcube.common.portal.GCubePortalConstants;
|
||||||
import org.gcube.common.portal.PortalContext;
|
import org.gcube.common.portal.PortalContext;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
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.common.storagehub.model.items.Item;
|
||||||
import org.gcube.oidc.rest.JWTToken;
|
import org.gcube.oidc.rest.JWTToken;
|
||||||
import org.gcube.portal.oidc.lr62.InvalidTokenException;
|
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.MissingTokenException;
|
||||||
import org.gcube.portal.oidc.lr62.NotAuthorizedException;
|
import org.gcube.portal.oidc.lr62.NotAuthorizedException;
|
||||||
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
||||||
import org.gcube.portal.oidc.lr62.RefreshException;
|
import org.gcube.portal.oidc.lr62.RefreshException;
|
||||||
import org.gcube.portal.oidc.lr62.UMAException;
|
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.AuthorizedUser;
|
||||||
import org.gcube.portlets.user.wswidget.shared.WSItem;
|
import org.gcube.portlets.user.wswidget.shared.WSItem;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ public class StorageHubServiceUtil {
|
||||||
try {
|
try {
|
||||||
long userId = PortalUtil.getUser(request).getUserId();
|
long userId = PortalUtil.getUser(request).getUserId();
|
||||||
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, userId, currentContext);
|
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, userId, currentContext);
|
||||||
UMATokensProvider.instance.set(umaToken.getRaw());
|
AccessTokenProvider.instance.set(JWTTokenUtil.getAccessTokenString(umaToken));
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ public class StorageHubServiceUtil {
|
||||||
String username = currentUsername;
|
String username = currentUsername;
|
||||||
try {
|
try {
|
||||||
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, username, currentContext);
|
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, username, currentContext);
|
||||||
UMATokensProvider.instance.set(umaToken.getRaw());
|
AccessTokenProvider.instance.set(JWTTokenUtil.getAccessTokenString(umaToken));
|
||||||
} catch (InvalidTokenException | MissingTokenException | RefreshException | NotAuthorizedException
|
} catch (InvalidTokenException | MissingTokenException | RefreshException | NotAuthorizedException
|
||||||
| UMAException e1) {
|
| UMAException e1) {
|
||||||
_log.warn("could not get UMA Token for context="+currentContext);
|
_log.warn("could not get UMA Token for context="+currentContext);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import javax.portlet.ResourceResponse;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.gcube.common.storagehub.client.StreamDescriptor;
|
import org.gcube.common.storagehub.client.StreamDescriptor;
|
||||||
import org.gcube.common.storagehub.client.dsl.FileContainer;
|
import org.gcube.common.storagehub.client.dsl.FileContainer;
|
||||||
|
@ -25,8 +25,9 @@ import org.gcube.common.storagehub.model.items.ExternalLink;
|
||||||
import org.gcube.common.storagehub.model.items.ExternalURL;
|
import org.gcube.common.storagehub.model.items.ExternalURL;
|
||||||
import org.gcube.common.storagehub.model.items.Item;
|
import org.gcube.common.storagehub.model.items.Item;
|
||||||
import org.gcube.oidc.rest.JWTToken;
|
import org.gcube.oidc.rest.JWTToken;
|
||||||
|
import org.gcube.portal.oidc.lr62.JWTTokenUtil;
|
||||||
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
||||||
import org.gcube.portal.oidc.lr62.UMATokensProvider;
|
|
||||||
import org.gcube.portlets.user.wswidget.shared.AuthorizedUser;
|
import org.gcube.portlets.user.wswidget.shared.AuthorizedUser;
|
||||||
import org.gcube.portlets.user.wswidget.shared.Breadcrumb;
|
import org.gcube.portlets.user.wswidget.shared.Breadcrumb;
|
||||||
import org.gcube.portlets.user.wswidget.shared.WSItem;
|
import org.gcube.portlets.user.wswidget.shared.WSItem;
|
||||||
|
@ -71,7 +72,7 @@ public class WorkspaceWidget extends MVCPortlet {
|
||||||
try {
|
try {
|
||||||
userId = PortalUtil.getUser(resourceRequest).getUserId();
|
userId = PortalUtil.getUser(resourceRequest).getUserId();
|
||||||
JWTToken umaToken = OIDCUmaUtil.getUMAToken(httpReq, userId, currentContext);
|
JWTToken umaToken = OIDCUmaUtil.getUMAToken(httpReq, userId, currentContext);
|
||||||
UMATokensProvider.instance.set(umaToken.getRaw());
|
AccessTokenProvider.instance.set(JWTTokenUtil.getAccessTokenString(umaToken));
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue