1

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.

1 Answer 1

4

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'
}));
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the example, which I was not able to find on the project page or login code.
Can you elaborate here? I'm stuck in the same boat. github.com/jaredhanson/passport-github/issues/22
@kevinSuttle probably not relevant anymore, but for future readers - it seems that you need to also/only pass the scope array to the Strategy constructor (where you pass the secrets and the callback)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.