NoamB / sorcery

Magical authentication for Rails 3 & 4
MIT License
2.31k stars 385 forks source link

MongoDB: authentications as embedded document #163

Open wclr opened 12 years ago

wclr commented 12 years ago

Didn't you think when using MongoDB to allow external authentications to be an embedded collection in a User collection object, not a separate collection with references?

johansl commented 12 years ago

+1 for external authentications using embedded relation using mongoid/mongodb :)

arnvald commented 10 years ago

Is it possible to find user by his embedded documents in MongoDB? I mean, if Twitter authentication is embedded, can I find user doing something like User.where("authentications.provider = 'twitter' and authentications.user_id = 'xxx')? If so, then it will be good idea. We're going to extract adapters for 1.0 release and maybe we'll be able to do it then.

arnvald commented 10 years ago

Ok, I've checked it, it's possible, it looks pretty esy to implement, I actually like the idea. The only problem is that it requires migrating data and changing models. Maybe we could do it for 1.0 release. @kirs, what do you think?

kirs commented 10 years ago

I'm not that good with Mongo, but the proposal looks interesting.