MongoDB Connection with options (authdb).

219 views
Skip to first unread message

George Antoniadis

unread,
Feb 25, 2013, 10:45:58 AM2/25/13
to mongoo...@googlegroups.com
Currently Mongoose doesn't support authenticating as an admin user and then using a different db.
This is something that can be easily done when using the native MongoDB driver by adding authdb in the connection options (MongoDB doc). 

Changing Mongoose's authentication function seems to do the trick.
I have written a patch to allow this functionality but unfortunately my knowledge of both mongoose and tests are less than basic.
So, could someone check out if this is indeed the right way to do this and if possible point me as to how the tests for this functionality should be?

Thank you very much in advance.

ps. There was a relevant issue in github to this https://github.com/LearnBoost/mongoose/issues/1114

Aaron Heckmann

unread,
Feb 25, 2013, 12:50:49 PM2/25/13
to mongoo...@googlegroups.com


--
--
http://mongoosejs.com - docs
http://plugins.mongoosejs.com - plugins search
http://github.com/learnboost/mongoose - source code
 
You received this message because you are subscribed to the Google
Groups "Mongoose Node.JS ORM" group.
To post to this group, send email to mongoo...@googlegroups.com
To unsubscribe from this group, send email to
mongoose-orm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mongoose-orm?hl=en
---
You received this message because you are subscribed to the Google Groups "Mongoose Node.JS ODM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongoose-orm...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Aaron


George Antoniadis

unread,
Feb 25, 2013, 3:35:44 PM2/25/13
to mongoo...@googlegroups.com
Thank you Aaron,
It was actually much easier than what I tried and much much cleaner.

I hope this is better.

George Antoniadis (Geoah)
Developer


Mobile: +30 6938 090 010
Email: geo...@noodles.gr
IM: geo...@noodles.gr (gtalk, live)

Aaron Heckmann

unread,
Feb 25, 2013, 7:32:01 PM2/25/13
to mongoo...@googlegroups.com
merged, thanks George!

George Antoniadis

unread,
Feb 27, 2013, 2:46:01 AM2/27/13
to mongoo...@googlegroups.com
Thanks for all your help :)

George Antoniadis (Geoah)
Developer


Mobile: +30 6938 090 010
Email: geo...@noodles.gr
IM: geo...@noodles.gr (gtalk, live)


Bg Sosh

unread,
Aug 14, 2015, 5:56:51 AM8/14/15
to Mongoose Node.JS ODM
These links don't seem to work anymore - is there a working copy somewhere?  Thanks.
Reply all
Reply to author
Forward
0 new messages