PHP/JS starting out - role of redirect page

Showing 1-1 of 1 messages
PHP/JS starting out - role of redirect page Cardinal177 4/18/12 3:42 PM
Hi All,

I configured a Web Application with a redirect page.  I'm starting out with the calendar example simple.php.  I filled in my ClientID, ClientSecret, RedirectUrl, and API Key (necessary?), but it appears getAccessToken never returns a token, thus skipping over the call to listCalendarList().

I thought the problem might be a OAuth2 one, so I worked through the OAuth2 for Web Server Apps tutorial and I got an initial call to oauth2 auth URL to go to a PHP redirect page.  In my redirect page I put in an HTML Form that takes 'code' from Google (via PHP) and with some hidden INPUT tags, is able to submit the form variable to the oauth2 token page, and low and behold, I get an access token in a json stream in a browser window.  At least it appears my account is set up properly. 

But sample.php hides all the OAuth2 stuff under the covers, right?  How does getAccessToken in sample.php get the access_token?  Does the redirect page somehow post it to sample.php? 

Maybe if anyone has a sample redirect page (PHP/JS), could they send it along?  Then maybe I can get sample.php to work properly.

Much appreciated for any advice!
Corey.