I've posted a more complete PHP example of 2LeggedOAuth on the GData
tips blog:
http://gdatatips.blogspot.com/2008/11/2-legged-oauth-in-php.html
Eric
On Nov 18, 3:03 pm, Lluis <[EMAIL PROTECTED]> wrote:
> Hi again,
>
> I'm almost finished coding two-legged OAuth
> Finally, I coded myself the integration with Zend Gdata
>
> The Padraid Brady classes don't cover two-legged simple
> characteristics
> I've copied code from oauth.php classes furnished by Eric(Google)
> Thanks a lot, Eric
>
> My last concerns are about Zend Gdata and its important lacks of
> functionality from a Google Apps Domain Administrator point of vue
>
> 1- Google Contacts Data API
> 2- two-legged OAuth
>
> They improve every month the library, but these aspects seems are not
> going to be covered on an inmediate enhacement
>
> Regards, Lluís
>
> On 13 nov, 22:00, Lluis <[EMAIL PROTECTED]> wrote:
>
> > Hi Eric,
>
> > Finally I successfully retrieved the contacts using your first
> > oaut.php script
>
> > There is an important error in function to_header() inside the
> > OAuthRequest class -line 368- needless a "
> > - $out ='"Authorization: OAuth realm="' . $realm . '",';
> > + $out ='Authorization: OAuth realm="' . $realm . '",';
>
> > Now I'm trying to code the same using Zend classes
> > It's no so easy for me, find the rigth order constructing classes
>
> > Regards, Lluís
>
> > On 13 nov, 17:38, "Eric (Google)" <[EMAIL PROTECTED]> wrote:
>
> > > On Nov 13, 7:33 am, Lluis <[EMAIL PROTECTED]> wrote:
>
> > > > Hi,
>
> > > > There isn't any example showing how could I setup a two-legged
> > > > consumer?
> > > > I'm trying with below options
>
> > > > $options = array(
> > > > 'requestScheme' => Zend_Oauth::REQUEST_SCHEME_QUERYSTRING,
> > > > 'version' => '1.0',
> > > > 'signatureMethod' => 'HMAC-SHA1',
> > > > 'consumerKey' => 'trad****.com',
> > > > 'consumerSecret' => 'nC9P/k**************',
> > > > );
> > > > $consumer = new Zend_OAuth_Consumer($options);
> > > > if (!isset($_SESSION['ACCESS_TOKEN'])) {
> > > > if (!empty($_GET)) {
> > > > $token = $consumer->getAccessToken($_GET, unserialize($_SESSION
> > > > ['REQUEST_TOKEN']));
> > > > $_SESSION['ACCESS_TOKEN'] = serialize($token);
> > > > } else {
> > > > $token = $consumer->getRequestToken();
> > > > $_SESSION['REQUEST_TOKEN'] = serialize($token);
> > > > $consumer->redirect();
> > > > }} else {
>
> > > > $token = unserialize($_SESSION['ACCESS_TOKEN']);
> > > > $_SESSION['ACCESS_TOKEN'] = null;
>
> > > > }
>
> > > With 2 legged OAuth you don't need to fetch any tokens. See my
> > > previous
> > > example. Just setup the consumer (as you've done), sign the request,
> > > and finally, make the request:
>
> > > // Proceed to query the Contacts Data API
> > > $contact = new Zend_Gdata($client);
> > > $query = new Zend_Gdata_Query('http://www.google.com/m8/feeds/contacts/
> > > default/full');
> > > $feed = $contact->getFeed($query);
>
> > > > I've the below exception message:
> > > > ........Could not retrieve a valid Token response from Token
> > > > URL.......
>
> > > > Could you help me configuring a two-legged consumer ?
>
> > > > Thanks in advance, Lluís
>
> > > > On 12 nov, 19:24, Trevor Johns <[EMAIL PROTECTED]> wrote:
>
> > > > > On Wed, Nov 12, 2008 at 9:19 AM, Eric (Google) <[EMAIL PROTECTED]>
> > > > > wrote:
>
> > > > > > Yes, the Google Data APIs have components in the Zend Framework,
> > > > > > but I haven't touched the new Zend/OAuth stuff.
>
> > > > > > It's still in the incubator:
> > > > > >http://framework.zend.com/svn/framework/standard/incubator/library/Zend/
>
> > > > > > See the test cases for example usage:
> > > > > >http://framework.zend.com/svn/framework/standard/incubator/tests/Zend...
>
> > > > > > All you would need to do is setup a Consumer with your consumer
> > > > > > secret
> > > > > > and key.
>
> > > > > > Eric
>
> > > > > Keep in mind the Zend_Oauth module is still in development. In
> > > > > particular, there's one bug that was hitting users on the Contacts API
> > > > > group who tried to implement this:
>
> > > > > http://framework.zend.com/issues/browse/ZF-4158
>
> > > > > Speaking of which, you can see their work here, which might help:
>
> > > > >
> > > > > http://groups.google.com/group/google-contacts-api/browse_thread/thre...
>
> > > > > --
> > > > > Trevor Johns
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Apps APIs" 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/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---