deleting the obviously censored post

## PHP Login with G+ take 2

It's Friday night, the kids are in bed, time to figure out how to log
into Google Plus using PHP.

Once the login is built I have three tasks concepts, and part of the
GOMA database schema sketched out.
I need to get through the log on piece so I can move onto more
interesting data visualization concepting.
My iPhone is currently being used as the noisemaker to put my children
to sleep so here are some sweet backwards Photo Booth photos of my
sketchbook.

Task #1 -> Color flag from Google+ Avatar
![MTA Notebook concepts
1](../project_images/GOMA_task_concept1.jpg?raw=true "MTA Notebook
concepts 1")

Task #2 -> "Draw a line" by setting a START, mid points, and END point.
![MTA Notebook concepts
1](../project_images/GOMA_task_concept2.jpg?raw=true "MTA Notebook
concepts 1")

Task #3 -> "Show me the Weather" by going outside and taking a picture
of your weather. Server then pulls up weather from API(s) based on GPS
and mashes the two together.  This is a Forecasted vs Actual weather
experiment.
![MTA Notebook concepts
1](../project_images/GOMA_task_concept3.jpg?raw=true "MTA Notebook
concepts 1")

All of this data needs a place to live.
![GOMA will need a database of some
kind](../project_images/GOMA_db_concept.jpg?raw=true "GOMA will need a
database of some kind")
I build servers and databases for a living, so this part will probably
be typical boring stuff.  Of course it will probably be a no sql
solution so at least that will be out of the ordinary.

Notes from the trenches.

ARRGGGHHH HULK SMASH!!!!!!!
![G+ PHP login error 1](../project_images/google-php-needs-curl.png "G+
PHP login error 1")
Seriously, this PHP login with Google+ is just annoyingly frustrating
to get working.  WTF?!?

![G+ PHP login error 2](../project_images/google_curlio_needs_curl.png
"G+ PHP login error 2")
Over the hills and through the woods to grandma's AppEngine we go. :(

Turns out this update to config.php really is the solution.  I've done
this a handful of times and it just didn't work for one reason or the
other.

## Example Code
```

    // Which Authentication, Storage and HTTP IO classes to use.
    'authClass'    => 'Google_OAuth2',
    'ioClass'      => 'Google_HttpStreamIO',
    'cacheClass'   => 'Google_MemcacheCache',

    // We need to configure fake values for memcache to work
    'ioMemCacheCache_host' => 'does_not_matter',
    'ioMemCacheCache_port' => '37337',

```

Do the config google-api-php-client/src/config.php dance, and now we
are cooking on localhost.
![PHP login with G+ on local
GAE](../project_images/localhost-gplus-login.png "PHP login with G+ on
local GAE")

Time to update the GAE console and see if this runs in the actual
cloud.  I couldn't seem to get my third party icon working with my
Gravatar icon, so I used the profile image from my PHPFICKES G+ page.
Try the app in GAE again.

![WINNER WINNER](../project_images/consent-screen.png "WINNER WINNER")
We have consent screen.

![CHICKEN DINNER](../project_images/logged-in.png "CHICKEN DINNER")
We have login with Google Plus using PHP!

It's time to step away from the computer and cool down a bit.  I will
post as I work through my other sketched out tasks above.

Party on Wayne.

## Links from tonight

- [Gravatar Image
Requests](http://en.gravatar.com/site/implement/images/ "Gravatar Image
Requests" )

- [Download
google-api-php-client](https://code.google.com/p/google-api-php-client/d
ownloads/list "Download google-api-php-client" )

- [Using the Google APIs Client Library for PHP with App
Engine](https://gae-php-tips.appspot.com/2013/08/06/using-the-google-api
s-client-library-for-php-with-app-engine "Using the Google APIs Client
Library for PHP with App Engine" )