Wrong number of segments in token (OAuth Google Api)

这一生的挚爱 提交于 2019-12-03 14:01:07
Tuan Truong Quang

Change:

$token_data = $client->verifyIdToken()->getAttributes();

to:

$tuan = $client->getAccessToken();
$token_data = $client->verifyIdToken($tuan->id_token);

You need to add the scope openid and then you get an id_token as well as the access token. You then use the id token with $client->verifyIdToken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!