Edward Tan
Edward Tan

Reputation: 954

passport-github support for Github's OAuth v3 APIs

I noticed that the https://github.com/jaredhanson/passport-github module supports OAuth v2 but hasn't been updated for awhile. Does anyone know whether it will be updated to support the current Github OAuth v3 APIs? Specifically I'm looking for a way to easily add the scopes list (similar to what https://github.com/pksunkara/octonode supports) as well as pass in the state for CSRF verification.

Upvotes: 1

Views: 831

Answers (1)

José F. Romaniello
José F. Romaniello

Reputation: 14166

You are confusing two different things, passport-github supports OAuth 2 which is the version of the OAuth protocol while Github API is in version 3.

With passport-github you can use scope and state as follow:

app.get('/auth/github', passport.authenticate('github', {
  scope: ['user', 'repo'],
  state: 'foobar'
}));

Upvotes: 4

Related Questions