,同時瞭解谷歌的oauth2,我看到了實現的oauth2數據來自谷歌後授權
選項1)兩個選項使用PHP客戶端庫服務器上 例如本地安裝 - 使用JavaScript,AJAX http://phppot.com/php/php-google-oauth-login/
選項2) ,PHP &谷歌平臺庫(直接從CDN) 示例 - http://w3lessons.info/2015/05/19/google-oauth-2-0-ajax-login-using-jquery-php-mysql/
我已經能夠實現兩者。不過,我有以下問題:
問題1) 在選項1 [$profile = $this->client->verifyIdToken()->getAttributes();]
給了我賬戶資料所僅email[email]
& google ID[sub]
包含。
輸出:的$profile
Array
(
[envelope] => Array
(
[alg] => R256
[kid] => ca6f0ece055ffa823454e56da
)
[payload] => Array
(
[iss] => accounts.google.com
[at_hash] => e5l-tvQpWQ
[aud] => 8pps.googleusercontent.com
[sub] => 186524872
[email_verified] => 1
[azp] => 1go.apps.googleusercontent.com
[email] => [email protected]
[iat] => 14543
[exp] => 14543
)
)
在選項2 [var profile = googleUser.getBasicProfile();]
給我其中包含全名&對谷歌ID &電子郵件
的頂部輪廓圖片鏈接配置文件數據有什麼功能,可以得到我的配置文件名&使用選項1的圖片鏈接(僅基於PHP的實現)
問題2)對於op
<div class="g-signin2" data-longtitle="true" data-onsuccess="Google_signIn" data-theme="light" data-width="200"/>