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/main/resources=UTF-8
|
||||||
encoding//src/test/java=UTF-8
|
encoding//src/test/java=UTF-8
|
||||||
encoding//src/test/resources=UTF-8
|
encoding//src/test/resources=UTF-8
|
||||||
encoding//target/generated-sources/gwt=UTF-8
|
|
||||||
encoding/<project>=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 {
|
public class RStudioServiceImpl extends RemoteServiceServlet implements RStudioService {
|
||||||
|
|
||||||
private static final Logger _log = LoggerFactory.getLogger(RStudioServiceImpl.class);
|
private static final Logger _log = LoggerFactory.getLogger(RStudioServiceImpl.class);
|
||||||
|
|
||||||
public static final String TEST_SCOPE = "/gcube/devsec/devVRE";
|
|
||||||
/**
|
/**
|
||||||
* the current ASLSession
|
* the current ASLSession
|
||||||
* @return the session
|
* @return the session
|
||||||
|
@ -36,7 +34,6 @@ public class RStudioServiceImpl extends RemoteServiceServlet implements RStudioS
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
|
_log.warn("USER IS NULL setting testing user and Running OUTSIDE PORTAL");
|
||||||
user = getDevelopmentUser();
|
user = getDevelopmentUser();
|
||||||
SessionManager.getInstance().getASLSession(sessionID, user).setScope(TEST_SCOPE);
|
|
||||||
}
|
}
|
||||||
return SessionManager.getInstance().getASLSession(sessionID, user);
|
return SessionManager.getInstance().getASLSession(sessionID, user);
|
||||||
}
|
}
|
||||||
|
@ -46,23 +43,13 @@ public class RStudioServiceImpl extends RemoteServiceServlet implements RStudioS
|
||||||
*/
|
*/
|
||||||
public String getDevelopmentUser() {
|
public String getDevelopmentUser() {
|
||||||
String user = "test.user";
|
String user = "test.user";
|
||||||
user = "costantino.perciante";
|
// user = "costantino.perciante";
|
||||||
return user;
|
return user;
|
||||||
}
|
}
|
||||||
private final static String DEFAULT_ROLE = "OrganizationMember";
|
|
||||||
@Override
|
@Override
|
||||||
public String retrieveRStudioSecureURL() throws IllegalArgumentException {
|
public String retrieveRStudioSecureURL() throws IllegalArgumentException {
|
||||||
_log.debug("retrieveRStudioSecureURL()");
|
String toReturn = "";
|
||||||
|
String token = getASLSession().getSecurityToken();
|
||||||
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();
|
|
||||||
try {
|
try {
|
||||||
_log.debug("calling rConnector with token = "+token);
|
_log.debug("calling rConnector with token = "+token);
|
||||||
toReturn = rConnector().build().connect().toURL().toExternalForm();
|
toReturn = rConnector().build().connect().toURL().toExternalForm();
|
||||||
|
|
Loading…
Reference in New Issue