-
Notifications
You must be signed in to change notification settings - Fork 414
Home
zquestz edited this page Feb 22, 2013
·
13 revisions
OmniAuth Google OAuth2 Strategy Strategy to auth with Google via OAuth2 in OmniAuth.
Get your API key at https://code.google.com/apis/console/
FAQ's
Answer: auth/google_oauth2
Answer: Example genericized hash returned from google:
{"provider"=>"google_oauth2",
"uid"=>"999999999999999999999",
"info"=>
{"name"=>"First Last",
"email"=>"First.Last@company_name.com",
"first_name"=>"First",
"last_name"=>"Last",
"image"=>
"https://lh3.googleusercontent.com/url/photo.jpg"},
"credentials"=>
{"token"=>"hash.of-stuff",
"expires_at"=>1354920555,
"expires"=>true},
"extra"=>
{"raw_info"=>
{"id"=>"999999999999999999999",
"email"=>"First.Last@company_name.com",
"verified_email"=>true,
"name"=>"First Last",
"given_name"=>"First",
"family_name"=>"Last",
"link"=>"https://plus.google.com/999999999999999999999",
"picture"=>
"https://lh3.googleusercontent.com/-some/url/photo.jpg",
"gender"=>"male",
"birthday"=>"0000-06-25",
"locale"=>"en",
"hd"=>"company_name.com"}
}
}
- You don't need the https://www.googleapis.com/auth/ prefix.
- You provide a comma separated list, without spaces.
- You need to give userinfo.email to get the email.