getCurrentUserToken fixed: it always returned null

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portal/portal-manager@134840 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-11-25 15:49:18 +00:00
parent 41919aad9a
commit 569838c6eb
1 changed files with 2 additions and 2 deletions

View File

@ -258,10 +258,10 @@ public class PortalContext {
*/
public String getCurrentUserToken(HttpServletRequest httpServletRequest) {
String groupIdNo = httpServletRequest.getHeader(VRE_ID_ATTR_NAME);
String userToken = null;
if (groupIdNo != null) {
String scope = getCurrentScope(httpServletRequest);
String username = getCurrentUser(httpServletRequest).getUsername();
String userToken = null;
try {
ScopeProvider.instance.set(scope);
userToken = authorizationService().resolveTokenByUserAndContext(username, scope);
@ -287,7 +287,7 @@ public class PortalContext {
return toReturn;
}
}
return null;
return userToken;
}
/**