This service lets you, a web-app developer, allow users to login to your site using Google Accounts.
Just click here to get started.
Looking for an example? Look no further.
That's actually why I made it - I couldn't use an OpenID server library from an App Engine application, but I could use an App Engine app to facilitate just the logins. (I'm still working on it.) It might be best to just implement OpenID and wait for that instead of using this directly.
When you want a user to login, send them to
pubkey should be the string labeled as "pubkey".
return_uri should be the URI you want to send the user back to.
a_token should be any token you can use to uniquely identify the user. You should store it in the user's session or similar.
Then, a POST will be made to the field marked as "uri". It will contain these fields:
key, which should be equal to "privkey" (check it!)
token, which is the token that you sent to the login page.
email, which is the user's email (and thus their Google Account).
nickname, which is their Google Account's name - if it's an @gmail.com or @googlemail.com email, the bit before the @. Otherwise, the whole address.
Simply store the email and nickname, keyed by the token in a temporary associative array. When you check if the user is logged in, look up the token in their session in the associative array, and if it's there, delete the entry and use the nickname and email for whatever nefarious purposes you want.
GAccProxy is not affiliated, endorsed, sponsored or supported by Google. Powered by Google App Engine.