我有谷歌登錄工作在我的網站,使用codeigniter-oauth2只是在最後一步,所有我得到的是:Codeigniter上的Google Login API返回空userinfo。有任何想法嗎?
的access_token
到期
,沒有別的!
這裏就是我請求數據:
$url = 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&' .
http_build_query(array('access_token' => $token->access_token,));
它確實充分循環,但是當我檢查出:
file_get_contents($url)
我什麼也沒得到!
這些都是我的範圍:
https://www.googleapis.com/auth/userinfo.profile
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/plus.profile.emails.read
我缺少一個範圍?還是我錯誤地要求信息?
此外,我正在使用v1
,應該使用v2
來代替嗎?
你可能會有更好的運氣與更近的東西。 https://github.com/google/google-api-php-client – DaImTo