I'm not able to get the email id from the Response Here the Response:
{
"id": "00000000000000",
"name": "Fred Example",
"given_name": "Fred",
"family_name": "Example",
"picture": ".jpg",
"locale": "en"
}
and this is what I'm using:
=' + token
I'm not able to get the email id from the Response Here the Response:
{
"id": "00000000000000",
"name": "Fred Example",
"given_name": "Fred",
"family_name": "Example",
"picture": "https://lh5.googleusercontent./-2Sv-4bBMLLA/AAAAAAAAAAI/AAAAAAAAABo/bEG4kI2mG0I/photo.jpg",
"locale": "en"
}
and this is what I'm using:
https://www.googleapis./oauth2/v1/userinfo?access_token=' + token
2 Answers
Reset to default 3You may need a different scope. According to documentation, the scope https://www.googleapis./auth/userinfo.profile
allows you to see basic profile info. In order to see the e-mail, you need this scope: https://www.googleapis./auth/userinfo.email
.
Now i'm able to get the email in respone, below is the code, where i changed the Response in the manifest
"oauth2": {
"client_id": "854569859639-9c0reicivklkv0ltpakv99iajqts5obs.apps.googleusercontent.",
"scopes": [ "https://www.googleapis./auth/userinfo.email" ]}
i changd the scope "scopes": [ "https://www.googleapis./auth/plus.login" ]
to
"scopes": [ "https://www.googleapis./auth/userinfo.email" ]
and below is the response
"{
"id": "00000000000000",
"name": "Fred Example",
"email":"[email protected]",
"given_name": "Fred",
"family_name": "Example",
"picture": "https://lh5.googleusercontent./-2Sv-4bBMLLA/AAAAAAAAAAI/AAAAAAAAABo/bEG4kI2mG0I/photo.jpg",
"locale": "en"
}"
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744104147a4558650.html
评论列表(0条)