php - Google Login API on Codeigniter is returning empty userinfo. Any ideas? -
I have a Google login works, except that the final step on my site, I it received from: < / P>
-
access_token
-
expire
Nothing else!
Here's where I am requesting data:
$ url = 'https://www.googleapis.com/oauth2/v1/userinfo? Alt = json & amp; .
http_build_query (array ('access_token' =>> $ Token-> Access_token,));
This completes the loop, but when I Czech Out:
file_get_contents ($ url)
found nothing to me!
These are my Scrop:
-
https: //www.googleapis.com/auth/userinfo.profile
-
https://www.googleapis.com/auth/userinfo.email
-
https://www.googleapis.com/auth/plus.profile.emails .read
Do I miss a scope? Or am I requesting wrong information?
In addition, I am using v1
, should I use v2
instead?
Try your scope is wrong:
- "< After this, you should make sure that your access token is valid. you can use, it was how to continue to tell you that the token and so on.
finally, as @ Dimato had suggested, you should probably start it you Google will install APIs with client libraries Has and makes it very easy to work with Google's OAuth 2 implementation.
Comments
Post a Comment