k33g / gh3

Client-side Javascript API wrapper for GitHub API V3
370 stars 79 forks source link

OAuth support needed #6

Closed atduskgreg closed 10 years ago

atduskgreg commented 11 years ago

It would be great if this library could support authentication via oauth tokens.

k33g commented 11 years ago

I'm not sure it is possible from frontend javascript. But if you have some sample about use of oauth only in the navigator, i can try. remark : gh3 is only for navigator (not server side)

flockonus commented 11 years ago

We are planning on using it as a chrome extension, it is possible, I believe that if the user can have a token then he would be able to make any request to GH as himself =)

datapimp commented 11 years ago

it is possible. you could use basic auth, and just base64 encode the username password to create an authorization, obtain a token

or you could use oauth, and set the request headers, provided the user of your library gave you a token. ( which is easy to get. )

we could provide an API for setting either of these tokens, and making sure they're passed with the requests.

I will see if I can make a pull request for this.

https://github.com/michael/github/blob/master/github.js#L42

k33g commented 10 years ago

gh3 is only for reading (for the moment) but giv it a try to https://github.com/michael/github