Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
PHP Example Source Code for a Secure signed request to a Google Service (Blogger)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
camoby  
View profile  
 More options Mar 1 2007, 1:35 pm
From: "camoby" <cam...@gmail.com>
Date: Thu, 01 Mar 2007 18:35:47 -0000
Local: Thurs, Mar 1 2007 1:35 pm
Subject: PHP Example Source Code for a Secure signed request to a Google Service (Blogger)
Hi,

After weeks of hair-tearing, I have finally worked out how to use PHP
and Curl to perform a Secure (Registered Web App) and 'signed' request
to a Google Service! Hurrah! ;)

In this example, I am using Blogger to list the Blogs associated with
the user's account.

No data is stored - I leave that up to you, but point out where you
need to do this.

It works like this:

0. Register your web application (the php script)
http://code.google.com/apis/accounts/RegistrationForWebApps.html

1. Provide a link for the user to click to go to Google, presenting a
Grant/Deny button to allow your script to use a particular Google
service ('scope') - note: If you see the Warning at this stage, your
script is not properly registered with Google.

2. This returns a single-use 'token'. In order have a token we can
store, to use again and again for your user, you need to 'Exchange'
this for a 'Session' token, which will never expire.

3. Perform an Authorized request to the exchange service.

4. This returns a token (key-value pair) which you can then store for
your user for future requests.

5. Now use this to request the Blogger API for a list of this user's
blogs.

The tricky bit can be in understanding the 'secure' 'signed' 'data'.
http://code.google.com/apis/accounts/AuthForWebApps.html#signingrequests

I have added plenty of comments and links in the PHP source presented
here to explain what is going on, each step of the way.

I hope this helps other like me, who were rapidly losing hair! ;)

Thanks to Pete Hopkins and Ryan Boyd for their assistance in the
Groups.

Here you go: http://kosso.co.uk/PHP/blogger_google_secure_AuthSub.phps

Cheers!
Kosso  [aka camoby]
http://kosso.wordpress.com
http://bloghud.com
http://podcast.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ryan Boyd (Google)  
View profile  
 More options Mar 2 2007, 4:16 am
From: "Ryan Boyd (Google)" <api.rb...@google.com>
Date: Fri, 02 Mar 2007 09:16:35 -0000
Local: Fri, Mar 2 2007 4:16 am
Subject: Re: PHP Example Source Code for a Secure signed request to a Google Service (Blogger)
Thanks Kosso for writing this up.  I'm sure it will be very valuable
to those looking at doing this in the future.

Happy coding,

-Ryan

On Mar 1, 10:35 am, "camoby" <cam...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »