passport
passport copied to clipboard
support Passport as Koa-middleware
Would be great to be able to use passport as part of koa.
Perhaps this could be a wrapper to expose the middleware (*) as generator functions instead.
Yep, I'm looking forward to implementing koa support. No ETA at the moment, but it'll happen.
Great to hear. Any pointers on what might need to be done? I may be able to help it move forward.
The files in the middleware
directory will need some adjusting. A first step would be to factor them into middleware/connect
and middleware/koa
, and see what common things can be abstracted.
+1 for this, would like to hear updates
+1
+1 as well
+1
I build a wrapper module: koa-passport. Unfortunately, to wrap the authentication
middleware it required some dirty workarounds. That is, the functionality for some options is missing. Only tested with LocalStrategy, yet.
@rkusa - Awesome, that looks like a great start! At some point in the next couple of weeks I want to put together a clean Koa implementation, potentially abstracting anything in Passport proper that could be shared. Would you mind if I modified your code and submitted a PR?
@jaredhanson Sure, and if it helps, I could add some comments to the source to explain the workarounds a little bit.
@rkusa That would help, thanks!
+1 great work!
@jaredhanson : @rkusa added some comments to https://github.com/rkusa/koa-passport/commit/a11c83f1e8efc58ed42d34d2b23338c543b921d3 last week.
I've made some unsuccessful tests with SoundcloudStrategy.
@oomathias if you want, I could take a look at your problem. Feel free to create a issue at koa-passwort providing some more information about your problem.
I saw jared refactored the code with a "framework" mechanism, so koa support should be done with that?
I just implemented that based on @rkusa 's work: https://github.com/ktmud/koa-passport-fw/blob/master/index.js
Should I make a PR or something?
+1
Any update on the status? I'm confused about how to use koa together with passport: koa-passport-fw, koa-passport or just passport?
@qur2 passport
does not work with Koa directly. That is, you have to use koa-passport
or koa-passport-fw
(both use the framework
mechanism introduced in passport
0.2.0).
Ok, thanks, I'll try both those project and see what I can achieve.
+1 for better integration without hacks & mocks.
+1
Definitely would be good to see a framework-agnostic core emerge as the ecosystem evolves. Especially once node hits 0.12 and koa approaches mainstream viability.
+1
still no progress?
₊1
+1
+1
+1
+1
+1
Notice that Authenticator.prototype.framework
function, So i build a Koa framework plugin module passport-koa to support Koa. It work like a plugin for passport passport.framework(passport-koa)
. Tested with CustomStrategy and JWTStrategy by now.