ASP.NET MVC 4, MongoDB, login implementation

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

I'm currently stuck trying to implement authentication for a system that will use MongoDB exclusively (so I have no way to leave the user table in the SQL database).

Now I have decided that the decision will be implemented by my own membership provider. However, this requires quite a bit of code. And, since it is related to safety, it is not advisable to drop the wheel if I can avoid it.

Coming from Rails, it would be pretty simple to add something like Devise, configure it to use MongoDB, and call it Day. I could not find anything like this for ASP.NET MVC - I'm not sure if this is an unusual use case, or if my Google-Fu is inadequate.

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

+4
source share
2 answers

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

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

+1
source

I would suggest using https://extmongomembership.codeplex.com/ as it is a newer provider that was introduced in ASP.NET MVC4. And these are even more functions (for example, if a permission system is required)

0
source

Source: https://habr.com/ru/post/1483378/


All Articles