Hello,
I would like to know if it's possible to use the current session in multisite installation to access REST server data...
I have a main site on "test.mysite.com", which define the REST services and endpoint. I have two sub-site on "shared.mysite.com" and "test.shared.com" (note the second isn't on the same domain name). All uses the same drupal core (pressflow) and the single-sign-on module and users / sessions / authmap are shared. Users are same in all sites, but permissions, content and others are differents. The goal is to retrieve specific data from main site to display it on the sub-site(s).
Now when I try to call Rest server from sub to main site, it seems that the "global $user" isn't defined correctly... On the main site, a "visibility" system allow user to share content to "public, only my friends (UR module) or only me". The node_access table is used to define visibility of the content.
In the main site, using db_rewrite_sql allow to provide only correct visibility content to the current user. But when I call the "node.retrieve" method to get data a the sub-site, I can't see "only my friends" content, even if the current user is friend of the content author...
So my question is simple : is there any way to link the current user from subsite with the session informations without asking for login / pwd to use it with "user.login" method ? In other words, is it possible to use the REST methods from sub-sites with the logged user ?
Thanks in advance for any suggestion.
Comments
Comment #1
titouilleFinally I made the following code :
And it seems all is ok. But it's a good way to do it like that ?? get correct session_id from correct domain doesn't break security or anything ?
Thanks for review
Comment #2
marcingy commentedClosing as we are now on rc3.