php - Google Sign-In endpoint doesn't return the user's name anymore -


i'm using google sign-in on ios app. working until when noticed app no longer gets user's name, email address returned.

i getting token through app sending server, used fetch full information sending request endpoint:

https://www.googleapis.com/oauth2/v1/tokeninfo?id_token=mytoken 

i'm getting kind of answer now:

{      "issuer": "https://accounts.google.com",     "issued_to": "o37l8g.apps.googleusercontent.com",     "audience": "o37l8g.apps.googleusercontent.com",     "user_id": "113504",     "expires_in": ​814,     "issued_at": ​1452991611,     "email": "myemail@gmail.com",     "email_verified": true  } 

i tried use other endpoints, https://www.googleapis.com/oauth2/v1/tokeninfo?access_token= , https://www.googleapis.com/oauth2/v1/userinfo?access_token=, none of them worked.

i tried playground cannot find endpoint use, scope defined , see in ios app permissions requested, somehow still doesn't return user's name... ideas?

you should use access_token instead of id_token, still able query tokeninfo endpoint token using:
https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=

but can query other endpoints access other informations, name:
https://www.googleapis.com/plus/v1/people/me?access_token=

check how use google signin ios sdk , make sure getting end sending server access_token instead of id_token.

example in swift:

 func signin(signin: gidsignin!, didsigninforuser user: gidgoogleuser!, witherror error: nserror!) {      let token = user.authentication.accesstoken // yes      let token = user.authentication.idtoken // maybe no   ... 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -