https://accounts.google.com/o/oauth2/auth?response_type=token&client_id=344630307125-hohabs1ktlmagr9f2lokergoruui2tdq.apps.googleusercontent.com&redirect_uri=http://stage-tw-member.iscarmg.com/test&scope=https://www.googleapis.com/auth/userinfo.profile + https://www.googleapis.com/auth/userinfo.email
http://stage-tw-member.iscarmg.com/test#access_token=ya29.GmBxBLkvoCf0q9-f1gSsiJXP5Tg4E3lCJ8ex_oz6VrFxjRorY1FHv6Fg1vaUBoIvbk0mM4gcvd5JNrAcay1aVTBTXbg1daiRZgOu0yc9N4yLrQSeHTc0m3lxfBRWKzc05S0&token_type=Bearer&expires_in=3600
設法將access_token切割出來,先將"#"之前的路徑切掉,然後再分割後面的字串變成陣列,取第一個陣列,就可以拿這個access_token去跟google要會員資料囉。
https://www.googleapis.com/oauth2/v3/userinfo?alt=json&access_token=ya29.GlxxBELlBAB6aD32RKDp5Ly58dgx8ZPUDXG3MK0joKfp9JtrW3CWRbE4FWu37ggimEDbB8CEAmLjcYc3aFit7aaIoSFimiY-wNOvjZB2rdx_3WboonZY4C_D5zWU9w
{
"sub": "會員ID",
"name": "全名",
"given_name": "last name",
"family_name": "first name",
"profile": "google+部落格",
"picture": "頭像路徑",
"email": "信箱",
"email_verified": 是否已經信箱驗證,
"gender": "性別",
"locale": "地區"
}