Gmail API, oauth2callback.php error, "This webpage has a redirect loop" [on hold]

Wednesday, November 4, 2015

Using Google App Engine, Gmail API, and google-api-php-client on Google Apps for Work users.



Step 1: Enable Gmail API in Google App Engine



Step 2: Download google-api-php-client and upload to web server



Step 3: Reference with "require_once '...path/autoload.php';"



Step 4: Use the OAuth 2.0 for Web Server Applications instructions. (not sure if this is the right option)



Step 5: Go to https://console.developers.google.com/apis/credentials page and select "Add credentials" -> "OAuth 2.0 client ID". This opens a list of options, I choose "Web application" (is that the correction option?). It asks for 2 url's, "Authorized JavaScript origins" and "Authorized redirect URIs" with examples, the second example doesn't include ".php", not sure if it needs to be included or not.



Step 6: Create file called "oauth2callback.php". Does this file need to be added to my "app.yaml" in order to be accessed?



Step 7: Add the "index.php" content to my PHP index page.



These steps provide the following results when I visit my website, redirects to "h*tps://mywebsite.com/oauth2callback.php" with the following error "This webpage has a redirect loop"

0 comments:

Post a Comment