jaredhanson / passport-github

GitHub authentication strategy for Passport and Node.js.
https://www.passportjs.org/packages/passport-github/?utm_source=github&utm_medium=referral&utm_campaign=passport-github&utm_content=about
MIT License
537 stars 290 forks source link

Does it work with express 4? #22

Closed leedorian closed 8 years ago

leedorian commented 10 years ago

Does it work with express 4? Is there express 4 example?

ghost commented 10 years ago

I've been trying. I updated the example to express 4 code (this is my first time using express 4, so hopefully I got it all right).... but I can't seem to get it to work. When I try to hit /auth/github which should go to github for me to log in, it automatically goes to the failureRedirect URL.

Wish I could get more info on this, sadly github is the only OAuth provider I want to use with my app... my app specifically is designed to use github gists.

spitimage commented 9 years ago

FWIW, I've been using this successfully with Express 4.

kevinSuttle commented 9 years ago

The auth call works, but I'm not having any luck getting data. /accounts just redirects to /, and it defaults to only getting public info, which you don't need auth for. Any subsequent API calls return undefined.

kevinSuttle commented 9 years ago

This works: https://github.com/aselbie/passport-github/blob/a6c9d34e2c6ee442e8a0906c1e5269507bd67984/examples/login/app.js Found in pull request: https://github.com/jaredhanson/passport-github/pull/31

tadman commented 9 years ago

I've had no problems with Express 4.x by following that example. Probably worth closing this issue to avoid worrying people.

jaredhanson commented 8 years ago

Examples have been moved to separate repositories. Closing.

Refer to this for a example using Express 4.0 and OAuth 2.0: https://github.com/passport/express-4.x-facebook-example