ashleydavis / mongodb-rest

REST Server for MongoDB (using node.js)
GNU Lesser General Public License v3.0
75 stars 34 forks source link

using passport for token based auth #9

Closed tuvokki closed 9 years ago

tuvokki commented 9 years ago

Hi,

it seems you have adopted this project, and I'm interested in it's basic functionality in combination with Angular. The only thing I still miss is some form of authentication. I've not read all code but I was wondering if passport and it's token-based authentication is a good alternative which seems to integrate relatively easy with express. I have been working with it in a sailsjs application (see: HunaJS) so if it seems like a viable route I like to pitch in with some code trying to make it work.

Or is there another way to achieve authentication based on the Bearer token like in passport-http-bearer.

For reference see: http://blog.jeroenpelgrims.be/token-based-sessionless-auth-using-express-and-passport/ http://stackoverflow.com/questions/21447155/implementing-passport-http-bearer-token-with-sails-js

Both examples are more than a year old so it might take a bit more work to actualize, but it doesn't sound that hard. Let me know what you think and if I can help.

Grz, Wouter

ashleydavis commented 9 years ago

I've just learnt about passport myself having just used it in a project. I would love to integrate it into mongodb-rest but I probably won't have the time for several months. I really want to get a plugin system in place so that authentication can use what every system, be it passport or something else.

If this is something you want to work on that would be awesome and you can become a contribute to mongodb-rest. You'd need to fork the repo and then together we could develop a plan for how you implement this.