oauth2-client: Not getting all the information from Github API.

For some reason I cannot get the email of my GitHub.

I tried to dig in the code did not find anything.

I even added the scope:

public $scopes = array('user:email');

I also tried:

public $scopes = array('user');

I get NULL.

It also seems that other information are not loading:

string(3) "uid"
int(--------) -> this works but I hid it.
string(8) "nickname"
string(5) "jnbdz"
string(4) "name"
string(19) "Jean-Nicolas Boulay"
string(9) "firstName"
NULL
string(8) "lastName"
NULL
string(5) "email"
NULL
string(8) "location"
NULL
string(11) "description"
NULL
string(8) "imageUrl"
NULL
string(4) "urls"
array(2) {
  ["GitHub"]=>
  string(18) "http://github.com/"
  ["Blog"]=>
  NULL
 }

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 20 (8 by maintainers)

Most upvoted comments

Found it!

After sifting trough the documentation I finally discovered that emails are not given via this url:

https://api.github.com/user?access_token=...

You need this url:

https://api.github.com/user/emails?access_token=...

For more info: http://developer.github.com/v3/users/emails/

Maybe it should be added to the library… Any suggestions?