Google Api get users Email Address

后端 未结 2 860
不知归路
不知归路 2021-01-24 08:39

I am using the Google Api PHP client to Log the user in. I want to get the Users Email address. I have the following code.

Scope:

$client->setScopes(\         


        
2条回答
  •  旧巷少年郎
    2021-01-24 08:47

    https://www.google.com/accounts/AuthSubRequest?next=http://www.example.com/index.php&scope=https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/analytics.readonly&secure=0&session=1 
    or
    https://www.google.com/accounts/AuthSubRequest?next=http://www.example.com/index.php&scope=email+https://www.googleapis.com/auth/analytics.readonly&secure=0&session=1
    

    both of above links works for me in php

提交回复
热议问题