Hey Tuhin, glad to hear your making some progress! I think the encoding of the token was changed a bit some 5 weeks ago, when we were working on the RESTful API support. Previously the token was always posted, but with the REST service it's often parsed as a $_GET, so the encoding had to be updated.
The simplest way to make sure 'it just works', is probably to copy the token code from partuza's gadget creating logic: http://code.google.com/p/partuza/source/browse/trunk/Application/Views/gadget/gadget.php?r=111 A quick look there will show that it now does a: "st=".urlencode(base64_encode($securityToken->toSerialForm())) to append the token to the URL. Ps, the best place for shindig development & usage questions is the shindig mailing list: [EMAIL PROTECTED] there's a lot more people there with knowledge of how php shindig works then on the generic 'container' list. See http://incubator.apache.org/shindig/#tab-support for how to sign up there. Good luck! -- Chris On Aug 18, 2008, at 4:15 PM, tuhin.barua wrote: > > Hey chris thanks for your help, i really appreciate it. > > I just wanted to confirm something. > > i updated my shindig from the svn after long time and now its not > working. > at first i was getting problem with file include paths and class > duplication, anyway i corrected that > > currently i am using this way > //// > > $OSPATH = '/home/www/shindig/trunk/php/'; > require_once($OSPATH.'config.php'); > require_once($OSPATH.'src/common/SecurityToken.php'); > require_once($OSPATH.'src/common/BlobCrypter.php'); > require_once($OSPATH.'src/common/samplecontainer/ > BasicBlobCrypter.php'); > require_once($OSPATH.'src/common/samplecontainer/ > BasicSecurityToken.php'); > > and i am generating token like this > > function getGadgetUrl($view = 'canvas'){ > $parent = 'http://mydevel.com/'; > > $owner = 'john.doe'; > $viewer = 'john.doe'; > $app = 'bitsapp'; > $domain = $parent; > $appUrl = 'http://opensocial.bolbakar.com/media/t.xml'; > $moduleId = 'bitsmodule'; > $token = BasicSecurityToken::createFromValues($owner, $viewer, > $app, > $domain, $appUrl, $moduleId); > $st = urlencode(base64_encode($token->toSerialForm())); > //$st = urlencode($token->toSerialForm()); > > $hosturl = 'http://dev.imodules.com/gadgets/ifr?'; > > $gadgetUrl = $hosturl . '&bpc=1&url='.urlencode($appUrl).'&st='. > $st.'&view='.$view.'&parent='.$parent; > > return $gadgetUrl; > } > > if i do $st = urlencode(base64_encode($token->toSerialForm())); > i am getting this in gadgets/ifr page inside javascript > ----------------- > <b>Notice</b>: Undefined offset: 1 in <b>/home/imodules/shindig/trunk/ > php/src/common/samplecontainer/BasicBlobCrypter.php</b> on line > <b>123</b><br /> > 257<br /> > 258<b>Notice</b>: Undefined index: t in <b>/home/imodules/shindig/ > trunk/php/src/common/samplecontainer/BasicBlobCrypter.php</b> on line > <b>131</b><br /> > 259<br /> > 260<b>Notice</b>: Undefined index: t in <b>/home/imodules/shindig/ > trunk/php/src/common/samplecontainer/BasicBlobCrypter.php</b> on line > <b>132</b><br /> > > and if i do $st = urlencode($token->toSerialForm()); > i am getting invalid gadget token error in jsonrequest > > but in plain text token all is working fine...... if i pass > st=owner:viewer:a:b:c:d > > also please note, before recent update sometimes it used to give > problem while authentication token, but sometimes it used to work > fine, without any changes > > also when i include shindig/trunk/php/src/common/samplecontainer/ > BasicBlobCrypter.php to generate token, i got require file error for > crypto.php, path was not working, so i changed path to src/common/ > samplecontainer/Crypto.php to Crypto.php > > can you put some light on this? > > thanks > Tuhin > > On Jul 9, 3:54 pm, Chris Chabot <[EMAIL PROTECTED]> wrote: >> AppId is whatever ID the container / site gives a gadget, module id >> is >> which instance of the gadget it is on that page, domain is your >> socialnetwork.com... So all your assumptions are indeed correct :) >> >> Shindig in it's self does use some of those values, for instance when >> a gadget wants to save some application data or create an activity, >> the app id in the security token is used to record which app this >> data >> belongs too .. a crucial bit of information in that case :) Also the >> owner and viewer id's that are encoded in the token are heavily used >> as you can imagine. >> >> Other fields can either be used by the container in it's data >> services >> (that you plug into shindig to couple it to your data layer), or will >> be used in the future (the proxy service should know which >> configuration to use, and for that it needs the domain key), so it's >> in your best interest to make sure you fill them in correctly so you >> don't get unexpected surprises down the road :) >> >> -- Chris >> >> On Jul 9, 2008, at 12:14 PM, tuhin.barua wrote: >> >> >> >>> Thanks... it works :) >> >>> I have another question for you, not so very important i guess >> >>> $token = new BasicSecurityToken(null, null, $owner, $viewer, $app, >>> $domain, $appUrl, $moduleId); >>> i do this to generate ST token.... >> >>> Can you tell me here whats the use of $app, $domain, $appUrl, >>> $moduleid ? it also dont restrict anything. i tried with some junk >>> values...and still all works fine. >>> I dont see much use of these parameters. can you give me an example? >>> anyway the way i understand, i guess it should be something like >>> ---- >>> eg: lets say its orkut opensocial >>> $app = orkut application id ?? >>> $domain =www.orkut.com >>> $appUrl =http://somedomain/myapp.xml >>> $moduleid = whats this now? >> >>> here appUrl supposed to be unique? and it shd point to one >>> particular >>> appid right? >>> so whats the use of moduleid? is it something like if someone add >>> same >>> app twice so in tht case appid will be same in both instance but >>> moduleid will be different? >>> i am not sure... i am just guessing >> >>> On Jun 27, 2:40 pm, Chris Chabot <[EMAIL PROTECTED]> wrote: >>>> Yep works for me, keep in mind that this is a container feature, >>>> and >>>> not a 'shindig' feature. >> >>>> What you need to do is create some javascript for your container >>>> site, >>>> that registers 'i can handle the requestNagivateTo rpc, with this >>>> function', seehttp://partuza.us.chabotc.com/js/container.jsfor >>>> example. >> >>>> Also when your setting up your server, and you support more then >>>> the >>>> 'profile' and 'canvas' view, don't forget to edit your shindig/ >>>> config/ >>>> container.js, and add your other view(s) to the "views" section >>>> (for >>>> instance partuza supports the home view so i added: >>>> "home" : { >>>> "isOnlyVisible" : false, >>>> "aliases": [] >>>> }, >> >>>> to views. >> >>>> ps i did double check by whiping up a quick navigate >>>> gadget:http://chabotc.com/navigate.xml >>>> when i add that to my site, and click the navigate links, it's >>>> working fine and dandy for me >> >>>> -- Chris >> >>>> On Jun 27, 2008, at 10:21 AM, tuhin.barua wrote: >> >>>>> hey chris >> >>>>> is this working currently in php server? >> >>>>> this is my app javascript which works in orkut >> >>>>> function nav(view,data){ >>>>> var supported_views = gadgets.views.getSupportedViews(); >>>>> d={ >>>>> q: data >>>>> } >>>>> gadgets.views.requestNavigateTo(supported_views[view],d); >>>>> } >> >>>>> here view = 'canvas' and data is appdata >>>>> ir orkut i call this function from profile view... and then it >>>>> gets >>>>> redirected to application canvas view with app params.... which >>>>> works >>>>> fine >>>>> but in my php server its not working.... i can see rpc_relay.html >>>>> getting called asynchronously in the firebug when i call this >>>>> function >>>>> same like orkut.... >> >>>>> - Tuhin > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Implementing OpenSocial Containers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/opensocial-container?hl=en -~----------~----~----~----~------~----~------~--~---
