From 2a0a14ddca877c98d4f0cb8fcc3c1095a786717d Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Tue, 26 Apr 2016 08:18:38 +0000 Subject: [PATCH] token set from ASL git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/rstudio-wrapper-portlet@128300 82a268e6-3cf1-43bd-a215-b396298e98cf --- .settings/org.eclipse.core.resources.prefs | 1 - .../server/RStudioServiceImpl.java | 19 +++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs index 160c7b8..29abf99 100644 --- a/.settings/org.eclipse.core.resources.prefs +++ b/.settings/org.eclipse.core.resources.prefs @@ -3,5 +3,4 @@ encoding//src/main/java=UTF-8 encoding//src/main/resources=UTF-8 encoding//src/test/java=UTF-8 encoding//src/test/resources=UTF-8 -encoding//target/generated-sources/gwt=UTF-8 encoding/=UTF-8 diff --git a/src/main/java/org/gcube/portlets/user/rstudio_wrapper_portlet/server/RStudioServiceImpl.java b/src/main/java/org/gcube/portlets/user/rstudio_wrapper_portlet/server/RStudioServiceImpl.java index fca7e08..c61cf98 100644 --- a/src/main/java/org/gcube/portlets/user/rstudio_wrapper_portlet/server/RStudioServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/rstudio_wrapper_portlet/server/RStudioServiceImpl.java @@ -24,8 +24,6 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet; public class RStudioServiceImpl extends RemoteServiceServlet implements RStudioService { private static final Logger _log = LoggerFactory.getLogger(RStudioServiceImpl.class); - - public static final String TEST_SCOPE = "/gcube/devsec/devVRE"; /** * the current ASLSession * @return the session @@ -36,7 +34,6 @@ public class RStudioServiceImpl extends RemoteServiceServlet implements RStudioS if (user == null) { _log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL"); user = getDevelopmentUser(); - SessionManager.getInstance().getASLSession(sessionID, user).setScope(TEST_SCOPE); } return SessionManager.getInstance().getASLSession(sessionID, user); } @@ -46,23 +43,13 @@ public class RStudioServiceImpl extends RemoteServiceServlet implements RStudioS */ public String getDevelopmentUser() { String user = "test.user"; - user = "costantino.perciante"; +// user = "costantino.perciante"; return user; } - private final static String DEFAULT_ROLE = "OrganizationMember"; @Override public String retrieveRStudioSecureURL() throws IllegalArgumentException { - _log.debug("retrieveRStudioSecureURL()"); - - String toReturn = "error retrieving token"; - List userRoles = new ArrayList<>(); - userRoles.add(DEFAULT_ROLE); - _log.debug("calling authorizationService() for user " + getASLSession().getUsername()); - String token = authorizationService().build().generate(getASLSession().getUsername(), userRoles); - // String token = getASLSession().getSecurityToken(); - _log.debug("token="+token); - SecurityTokenProvider.instance.set(token); - getASLSession().getSecurityToken(); + String toReturn = ""; + String token = getASLSession().getSecurityToken(); try { _log.debug("calling rConnector with token = "+token); toReturn = rConnector().build().connect().toURL().toExternalForm();