5

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?

4

2 回答 2

1

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

MongoDB 的 ASP.NET 提供程序(缓存、成员资格、配置文件、角色、会话状态、Web 事件)的集合。

于 2013-05-29T17:00:59.927 回答
0

我建议使用https://extmongomembership.codeplex.com/,因为这是 ASP.NET MVC4 中提供的较新的提供程序。它还包含更多功能(例如,如果需要,权限系统)

于 2013-07-26T16:42:37.520 回答