[Zoo-discuss] ZOO-client and ZOO-API : concepts and usage

Fenoy Gerald gerald.fenoy at geolabs.fr
Fri Jun 10 12:44:02 PDT 2016


Dear Rakesh,
thanks for your feedbacks, this is perfectly correct.

I was speaking about passing the cookie through requests, for the specific case where you are chaining your services, by using JavaScript ZOO-API or simply WPS XML POST requests which can embed cookie information too.

Best regards,

> Le 10 juin 2016 à 20:42, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
> 
> Dear Gerald,
> 
> Thanks a lot for the explanation.   I previously had a look at [lenv] and [senv] but couldn't relate it to my problem. Here is my understanding:
> 
> There is a "LogIn" WPS service. In this service, we can set up a cookie using conf [lenv] [cookie]. After this step, we can save key-value pairs in conf[senv] map. 
> 
> When the user calls   the "LogIn" service, ZOO-kernel returns the cookie (created in [lenv]) to the browser. From now onwards, all the WPS requests coming from this browser session will have the cookie information. So if the user calls another service (after LogIn service), his WPS execute request will send the cookie and ZOO-kernel will detect this cookie and will load the corresponding [senv] map before invoking the service. And inside the service, we can access conf[senv] map and can read all the information that we stored previously via the LogIn service.
> 
> In LogIn Java service:
> 
>                 HashMap lenvMap = (HashMap) (conf.get("lenv"));
> 		lenvMap.put("cookie", "XXX=MM10001" + "; path=/");
> 
> 		HashMap senvMap = new HashMap();
> 		senvMap.put("XXX", "MM10001);
> 		senvMap.put("userid", "rakesh");
> 		conf.put("senv", senvMap);
> 
> In second service:
> 
> 		HashMap senvMap = (HashMap) (conf.get("senv"));
> 		String userid = (String) senvMap.get("userid");
> 
> Hope this is correct.
> 
> regards
> 
> 
> 
> 
> 
> > Subject: Re: [Zoo-discuss] ZOO-client and ZOO-API : concepts and usage
> > From: gerald.fenoy at geolabs.fr
> > Date: Fri, 10 Jun 2016 14:46:07 +0200
> > CC: zoo-discuss at lists.osgeo.org
> > To: rakeshuk at outlook.com
> > 
> > Hi Rakesh,
> > I have just answered your previous email.
> > 
> > > Le 10 juin 2016 à 14:23, rakesh prithiviraj <rakeshuk at outlook.com> a écrit :
> > > 
> > > Hi Gerald,
> > > 
> > > To summarize my previous email:
> > > 
> > > Is there any way to get access to additional information from within the process/service context. ? As of now, the processor receives three parameters (inputs,outputs, conf) and i am interested to know if there is a possibility to get access to run time information (like user-id, job id created by ZOO-Kernel, etc) within the processor context. Note that this information is not part of WPS Execute request (inputs,outputs).
> > 
> > The only way I know to deal with this is to use cookie and sessions informations. The user authenticate through a WPS service which create a cookie identifier and store it in the cookie key of the [lenv] section. The service also store informations required by your application to understand that your user has been authenticated, for example the userid. Then the web application or requests sent by another client, have to forward the cookie informations into each requests they are producing to make sure the session will pass through all the WPS chain.
> > 
> > > 
> > > If this is possible, then I don't need a middle layer between ZOO-client and ZOO-kernel.
> > 
> > I d’ont think you need any middle layer for this and I hope to have make my point clear.
> > 
> > Best regards,
> > 
> > 
> > Gérald Fenoy
> > http://wiki.osgeo.org/wiki/User:Djay
> > 



Gérald Fenoy
http://wiki.osgeo.org/wiki/User:Djay



More information about the Zoo-discuss mailing list