k33g / gh3

Client-side Javascript API wrapper for GitHub API V3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OAuth support needed

atduskgreg opened this issue · comments

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

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)

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 =)

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

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