Skip to main content
100%

Gist 525907

✓ Published0🌍 Public
XXXX
Last edited Aug 15, 2010
Created on Aug 15, 2010

This Ruby code defines an OmniAuth strategy for authenticating users with Google via OAuth, then retrieves basic profile information from the Google Contacts feed. It uses the `omniauth/oauth` library and the `multi_json` gem to parse the JSON response from `http://www.google.com/m8/feeds/contacts/default/full?max-results=1&alt=json`. The strategy extracts the user’s email and name from the feed’s `id` and `author` fields, falling back to the email if the name is unknown. It overrides the request phase to include a scope parameter for the contacts feed.

AI-generated description

Similar vizzes