Git Product home page Git Product logo

Comments (20)

jnbdz avatar jnbdz commented on May 14, 2024 2

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?

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

Does the GitHub API return an email? Some Apis don't.

Sent from my iPhone

On Jul 8, 2013, at 6:08 PM, Jean-Nicolas Boulay [email protected] wrote:

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
}

Reply to this email directly or view it on GitHub.

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

Also when I do:

dd(json_decode($response));

In public function getUserDetails, I get allot of other information but not the email and I have notice that the name of some of the values have changed. For exemple it's not imageUrl it is now: avatar_url.

Also found another bug in the code:

$user->urls = array(
        'GitHub' => 'http://github.com/'.$response->login,
        'Blog' => $response->blog,
    );

It used to be like this:

$user->urls = array(
        'GitHub' => 'http://github.com/'.$user->login,
        'Blog' => $user->blog,
    );

That's why it was empty.

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

I haven't tried manually. But when I force it with:

dd(json_decode($response));

I still get a email null.

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

Maybe?

Phil Sturgeon

On Tuesday, July 9, 2013 at 12:41 AM, Jean-Nicolas Boulay wrote:

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=...
Maybe it should be added to the library... Any suggestions?


Reply to this email directly or view it on GitHub (#9 (comment)).

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

I actually started modifying OAuth-Client to support other OAuth2 providers but also Twitter new API. I will post a link when I am done to my version of oauth-client.

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

This is an OAuth 2 client, not an OAuth 1 client. Don't mix the two in together, it gets silly.

Phil Sturgeon

On Thursday, July 11, 2013 at 12:31 PM, Jean-Nicolas Boulay wrote:

I actually started modifying OAuth-Client to support other OAuth2 providers but also Twitter new API. I will post a link when I am done to my version of oauth-client.


Reply to this email directly or view it on GitHub (#9 (comment)).

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

Yah! lol I just realize... That Twitter was using OAuth1.0a or just 1? Anyways... The same with Yahoo... I was trying to add support for other OAuth providers... But now I am seeing that some are using OAuth1/1.0a.

But WordPress seems to be using OAuth2 but the token needs to be put in the header... So I added that option in the code. I haven't change anything for OAuth1. I am thinking of using another PHP lib for that.

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

Yeah 1 and 2 need to remain separate, we're working on on for OAuth 1 now. Then an abstraction lib can sit on top, but the components need to be separate.

Phil Sturgeon

On Thursday, July 11, 2013 at 12:44 PM, Jean-Nicolas Boulay wrote:

Yah! lol I just realize... That Twitter was using OAuth1.0a or just 1? Anyways... The same with Yahoo... I was trying to add support for other OAuth providers... But now I am seeing that some are using OAuth1/1.0a.
But WordPress seems to be using OAuth2 but the token needs to be put in the header... So I added that option in the code. I haven't change anything for OAuth1. I am thinking of using another PHP lib for that.


Reply to this email directly or view it on GitHub (#9 (comment)).

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

You work for php-loep?

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

I see that php-loep has a OAuth1 lib... But it's empty. Not very practical. Do you guys need help? I am willing to help, now. Because I really needed it.

from oauth2-client.

alexbilbie avatar alexbilbie commented on May 14, 2024

php-loep is a Github organisation which stands for "PHP League of Extraordinary Packages"

On 11 Jul 2013, at 17:55, Jean-Nicolas Boulay [email protected] wrote:

You work for php-loep?


Reply to this email directly or view it on GitHub.

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

The OAuth 1 client is being worked on by @bencorlett. Ask him if he'd like some help.

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

Sorry it's getting a bit out of subject, but Google forces me to check if I accept my application to talk to it every time I try to get a new token. Other services just ask once.

from oauth2-client.

cyrusdavid avatar cyrusdavid commented on May 14, 2024

There's actually a query parameter for that, see approval_prompt.

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

Thanks! I will look into it.

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

The Google issues are being taken care of elsewhere.

If anyone is interested in updating GitHub to get the email address back they are welcome to do so in a PR.

from oauth2-client.

jnbdz avatar jnbdz commented on May 14, 2024

PR?

from oauth2-client.

philsturgeon avatar philsturgeon commented on May 14, 2024

PR = Pull Request.

from oauth2-client.

cyrusdavid avatar cyrusdavid commented on May 14, 2024

PR = Please Reply

On Tue, Nov 26, 2013 at 11:58 PM, Phil Sturgeon [email protected]:

PR = Pull Request.


Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-29304139
.

from oauth2-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.