This commit is contained in:
Lucio Lelii 2016-09-08 14:42:26 +00:00
parent 7b76a50554
commit a1cb85737b
2 changed files with 4 additions and 3 deletions

View File

@ -187,7 +187,7 @@
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<version>[2.0.0-SNAPSHOT,3.0.0-SNAPSHOT)</version>
<scope>provided</scope>
<exclusions>
<exclusion>

View File

@ -1,6 +1,7 @@
package org.gcube.dataanalysis.wps.statisticalmanager.synchserver.mapping;
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
import org.gcube.common.authorization.library.provider.ClientInfo;
import org.gcube.common.authorization.library.provider.UserInfo;
import org.gcube.common.scope.api.ScopeProvider;
@ -24,8 +25,8 @@ public class TokenManager {
scope = ScopeProvider.instance.get();
System.out.println("Credentials from the GHN: scope: "+scope);
//get username from SmartGears
UserInfo token = AuthorizationProvider.instance.get();
username = token.getUserName();
ClientInfo token = (UserInfo) AuthorizationProvider.instance.get().getClient();
username = token.getId();
System.out.println("Credentials from the GHN: user: "+username);
}catch(Exception e){
e.printStackTrace();