Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 4, MongoDB, implementing login

I've used MongoDB before, but never with ASP.NET MVC.

Currently, I'm stuck trying to implement authentication for system which is going to use exclusively MongoDB (so, I don't have the option of leaving the users table to a SQL database).

Now, I figured a solution would be implementing my own Membership provider. However, that requires quite a lot of code. And, since it is related to security, it is not wise to reivent the wheel if I can avoid it.

Coming from Rails, it would be rather simple to just add something like Devise, set it up to use MongoDB and call it a day. I couldn't find anything similar for ASP.NET MVC - I am not sure if it is an uncommon use case, or if my Google-Fu is inadequate.

I don't need anything fancy -just the ability to create users, check their credentials and protect controllers from being called from unauthenticated users. Are there any packages that could solve my problem?

like image 307
Stephen Eilert Avatar asked Nov 12 '22 04:11

Stephen Eilert


1 Answers

https://github.com/osuritz/MongoDB.Web

A collection of ASP.NET providers (caching, membership, profiles, roles, session state, web events) for MongoDB.

like image 90
Ebubekir Dirican Avatar answered Nov 15 '22 05:11

Ebubekir Dirican