Authorization token check added
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/application-support-layer/applicationSupportLayerCore@119056 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
91735b2c23
commit
3d672344f2
8
pom.xml
8
pom.xml
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.applicationsupportlayer</groupId>
|
<groupId>org.gcube.applicationsupportlayer</groupId>
|
||||||
<artifactId>aslcore</artifactId>
|
<artifactId>aslcore</artifactId>
|
||||||
<version>4.6.1-SNAPSHOT</version>
|
<version>4.6.2-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>Application Support Layer Core</name>
|
<name>Application Support Layer Core</name>
|
||||||
<description>Library supporting dissemination of gCube content with OAI-ORE</description>
|
<description>Library supporting dissemination of gCube content with OAI-ORE</description>
|
||||||
|
@ -39,7 +39,11 @@
|
||||||
-->
|
-->
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.common</groupId>
|
||||||
|
<artifactId>common-authorization</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.ehcache</groupId>
|
<groupId>net.sf.ehcache</groupId>
|
||||||
|
|
|
@ -10,21 +10,21 @@ import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
|
||||||
|
import org.gcube.application.framework.accesslogger.library.impl.AccessLogger;
|
||||||
|
import org.gcube.application.framework.accesslogger.model.LoginToVreAccessLogEntry;
|
||||||
|
import org.gcube.application.framework.core.util.ASLGroupModel;
|
||||||
|
import org.gcube.application.framework.core.util.GenderType;
|
||||||
|
import org.gcube.application.framework.core.util.SessionConstants;
|
||||||
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
|
import org.gcube.common.scope.impl.ScopeBean;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.SAXException;
|
|
||||||
import org.gcube.application.framework.accesslogger.library.impl.AccessLogger;
|
|
||||||
import org.gcube.application.framework.accesslogger.model.LoginToVreAccessLogEntry;
|
|
||||||
//import org.gcube.application.framework.core.security.PortalSecurityManager;
|
//import org.gcube.application.framework.core.security.PortalSecurityManager;
|
||||||
import org.gcube.application.framework.core.util.ASLGroupModel;
|
|
||||||
import org.gcube.application.framework.core.util.GenderType;
|
|
||||||
import org.gcube.application.framework.core.util.SessionConstants;
|
|
||||||
//import org.gcube.application.framework.core.util.UserCredential;
|
//import org.gcube.application.framework.core.util.UserCredential;
|
||||||
//import org.gcube.common.core.scope.GCUBEScope;
|
//import org.gcube.common.core.scope.GCUBEScope;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
|
||||||
import org.gcube.common.scope.impl.ScopeBean;
|
|
||||||
//import org.gridforum.jgss.ExtendedGSSCredential;
|
//import org.gridforum.jgss.ExtendedGSSCredential;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -44,6 +44,7 @@ public class ASLSession{
|
||||||
// private ExtendedGSSCredential credential;
|
// private ExtendedGSSCredential credential;
|
||||||
private String parentScope;
|
private String parentScope;
|
||||||
private String scope;
|
private String scope;
|
||||||
|
private String securityToken;
|
||||||
private HashMap<String, Notifier> notifiers;
|
private HashMap<String, Notifier> notifiers;
|
||||||
String scopeName;
|
String scopeName;
|
||||||
private ASLGroupModel groupModel;
|
private ASLGroupModel groupModel;
|
||||||
|
@ -360,6 +361,12 @@ public class ASLSession{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setSecurityToken(String token){
|
||||||
|
SecurityTokenProvider.instance.set(token);
|
||||||
|
this.securityToken = token;
|
||||||
|
}
|
||||||
|
|
||||||
public void logUserLogin(String scope) {
|
public void logUserLogin(String scope) {
|
||||||
innerSession.clear();
|
innerSession.clear();
|
||||||
loggedIn = true;
|
loggedIn = true;
|
||||||
|
@ -446,4 +453,9 @@ public class ASLSession{
|
||||||
public GenderType getUserGender() {
|
public GenderType getUserGender() {
|
||||||
return this.gender;
|
return this.gender;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getSecurityToken() {
|
||||||
|
logger.info("getting security token: " + securityToken+" in thread "+Thread.currentThread().getId());
|
||||||
|
return securityToken;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||||
import org.gcube.common.scope.api.ScopeProvider;
|
import org.gcube.common.scope.api.ScopeProvider;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -39,6 +40,10 @@ public class SessionManager {
|
||||||
if (session.getScope()!=null) //covers first helper's invocation
|
if (session.getScope()!=null) //covers first helper's invocation
|
||||||
ScopeProvider.instance.set(session.getScopeName());
|
ScopeProvider.instance.set(session.getScopeName());
|
||||||
|
|
||||||
|
if (session.getSecurityToken()!=null){
|
||||||
|
logger.info("Setting SecurityTokenProvidet to: "+session.getSecurityToken()+" in thread "+Thread.currentThread().getId());
|
||||||
|
SecurityTokenProvider.instance.set(session.getSecurityToken());
|
||||||
|
}
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue