TNO database webservice : cookies functions
getNewCookie
Create a new authentication cookie and return it. The cookie is inactivated after 30 to 45 min of inactivity but it is recommenced to close it manually when you don't need it anymore.
SOAP
getNewCookie();
Returns the cookie, cookies are case sensitive
REST
GET http://tnodb.obs-besancon.fr/ws/tno/cookie
HTTP return code should be "200". The cookie is returned in the body.
getCookieDetails
Get details of the cookie.
SOAP
getCookieDetails(cookie);
Returns a array containing the list of the user's rights
REST
GET http://tnodb.obs-besancon.fr/ws/tno/cookie/{cookie}
All readable data stored in the cookie. The result is an JSON encoded object.
GET http://tnodb.obs-besancon.fr/ws/tno/cookie/{cookie}/{param}
Parameters in URL:
- cookie: the cookie
- param: the parameter to return, case sensitive (ex : ossos)
The value stored in the cookie for the required parameter.
addOSSOStoCookie
This function try to log in OSSOS and add it in authorizations.
SOAP
addOSSOStoCookie(cookie, username, password);
Parameters:
- cookie: the cookie
- username: a login for CADC website
- password: the password of the login
Returns true if authorization granted, false otherwise
REST
POST http://tnodb.obs-besancon.fr/ws/tno/cookie/{cookie}/ossos
Parameter in URL:
Parameters in POST body:
- user: a login for CADC website
- pass: the password of the login
HTTP return code should be "200". If the authorization is granted the body is "1" else authorization has failed. When authorization is failed due to invalid user/pass the return code will be "200" too, check the returned body !
removeCookie
Invalidate the authentication cookie.
SOAP
removeCookie(cookie);
Parameter:
- cookie: the cookie to delete
Returns always true
REST
DELETE http://tnodb.obs-besancon.fr/ws/tno/cookie/{cookie}
Parameter:
- cookie: the cookie to delete
Back to documentation