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
This commit is contained in:
parent
ce745d1926
commit
2a0a14ddca
|
@ -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/<project>=UTF-8
|
||||
|
|
|
@ -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<String> 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();
|
||||
|
|
Loading…
Reference in New Issue