Feature #21507 support new UMATokensProvider class
This commit is contained in:
parent
7d43b96e11
commit
e9330f651e
|
@ -4,48 +4,66 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="workspace-widget-portlet">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="context-root" value="workspace-widget-portlet"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="java-output-path" value="/workspace-widget-portlet/target/classes"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</project-modules>
|
||||
|
|
|
@ -4,9 +4,13 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.5.1-SNAPSHOT] - 2021-05-25
|
||||
|
||||
- Feature #21507 support new UMATokensProvider class
|
||||
|
||||
## [v1.5.0] - 2021-04-06
|
||||
|
||||
Removed legacy auth dependency
|
||||
- Removed legacy auth dependency
|
||||
|
||||
## [v1.4.1] - 2021-01-26
|
||||
|
||||
|
|
10
pom.xml
10
pom.xml
|
@ -13,7 +13,7 @@
|
|||
<artifactId>workspace-widget-portlet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>workspace-widget-portlet Portlet</name>
|
||||
<version>1.5.0</version>
|
||||
<version>1.5.1-SNAPSHOT</version>
|
||||
<description>
|
||||
Workspace Widget Portlet is a small Front-end component looking like G Drive which exposes the content of the user's workspace or VRE Folders in read only mode.
|
||||
</description>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<version>3.6.2-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -79,7 +79,11 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>oidc-library-portal</artifactId>
|
||||
<version>[1.3.0-SNAPSHOT, 2.0.0)</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>oidc-library</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
|
|
@ -7,7 +7,7 @@ import java.util.List;
|
|||
import javax.portlet.ResourceRequest;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.UmaJWTProvider;
|
||||
|
||||
import org.gcube.common.portal.GCubePortalConstants;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
@ -22,6 +22,7 @@ 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;
|
||||
|
||||
|
@ -146,7 +147,7 @@ public class StorageHubServiceUtil {
|
|||
try {
|
||||
long userId = PortalUtil.getUser(request).getUserId();
|
||||
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, userId, currentContext);
|
||||
UmaJWTProvider.instance.set(umaToken.getRaw());
|
||||
UMATokensProvider.instance.set(umaToken.getRaw());
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
@ -173,7 +174,7 @@ public class StorageHubServiceUtil {
|
|||
String username = currentUsername;
|
||||
try {
|
||||
JWTToken umaToken = OIDCUmaUtil.getUMAToken(request, username, currentContext);
|
||||
UmaJWTProvider.instance.set(umaToken.getRaw());
|
||||
UMATokensProvider.instance.set(umaToken.getRaw());
|
||||
} catch (InvalidTokenException | MissingTokenException | RefreshException | NotAuthorizedException
|
||||
| UMAException e1) {
|
||||
_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.HttpServletResponse;
|
||||
|
||||
import org.gcube.common.authorization.library.provider.UmaJWTProvider;
|
||||
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.storagehub.client.StreamDescriptor;
|
||||
import org.gcube.common.storagehub.client.dsl.FileContainer;
|
||||
|
@ -26,6 +26,7 @@ import org.gcube.common.storagehub.model.items.ExternalURL;
|
|||
import org.gcube.common.storagehub.model.items.Item;
|
||||
import org.gcube.oidc.rest.JWTToken;
|
||||
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.Breadcrumb;
|
||||
import org.gcube.portlets.user.wswidget.shared.WSItem;
|
||||
|
@ -70,7 +71,7 @@ public class WorkspaceWidget extends MVCPortlet {
|
|||
try {
|
||||
userId = PortalUtil.getUser(resourceRequest).getUserId();
|
||||
JWTToken umaToken = OIDCUmaUtil.getUMAToken(httpReq, userId, currentContext);
|
||||
UmaJWTProvider.instance.set(umaToken.getRaw());
|
||||
UMATokensProvider.instance.set(umaToken.getRaw());
|
||||
} catch (Exception e1) {
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue