Hey Loic,

Using the 2 legged variant is quite simple, just change the $auth bit from:

$auth =
osapiOAuth3Legged::performOAuthLogin('ddf4f9f7-f8e7-c7d9-afe4-c6e6c8e6eec4',
'6f0e1a11ac45caed32d699f9e92ae959', $storage, $provider, $localUserId);
to:
new osapiOAuth2Legged("OAuth Key", "OAuth Secret", 'The User ID for which
you want to do something');

Where the oauth key & token are the ones from the edit applications
overview, and the user id on who's behalf you want to perform your actions.

After that you can use the $osapis->appdata-> get / create / update / delete
functions as you would expect to be able to use them :)

Do note that most containers have the restriction that someone needs to have
the app installed (identified by the oauth key/secret) to be able to
retrieve and/or modify their data.

    -- Chris

On Fri, Jul 3, 2009 at 9:39 AM, Loic Dachary <l...@dachary.org> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> I've been able to play with
>
> http://pokersource.info/opensocial-php-client/examples/appData.php?test=partuza
> and modify the application data of all the installed application of my
> account at http://partuza.nl/ :-)
>
> Unless I'm mistaken, this example uses a three legged OAuth dialog (
> i.e. I'm redirected to partuza.nl and required to login before it
> works and the appData.php code has access to  the app data of all the
> installed applications, not just a designated application ).
>
> I would be most interested in a two legged variation where I would set
> the consumer key and secret ( as found in the page describing the
> installed application on my partuza.nl account ). I could try to guess
> a sensible set of api calls that would accomplish this. But I'm
> currently in a great state of confusion regarding the OAuth
> implementation/logic and a working example would bring some stability
> in my world ;-)
>
> Thanks in advance
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkpNtakACgkQ8dLMyEl6F22+WwCeOkrVRVMUjXPLcP4+FZ+iSHCg
> dGMAoKMvFwsujkIdzBMlsUToWK2wAbjl
> =8KST
> -----END PGP SIGNATURE-----
>
>

Reply via email to