Membership systems for MVC4 that support RavenDB
Asked Answered
Z

2

12

I create a lot of quick "proof of concept" MVC apps and I actually found the SimpleMembership provider that shipped with the MVC4 templates to be very handy since it gets me up and running with user registration & OAuth in a matter of minutes.

But...I've started to use RavenDb (on RavenHQ for a lot for my projects). So, I starting trying to implement my own "custom membership provider" based on the ExtendedMembershipProvider and while doing that I realized that didn't make much sense. I later stumbled upon 2 interesting projects that try to solve this exact problem:

Both are pretty interesting recent efforts and was wondering if these are the only ones being built right now. I'm essentially looking for nuget pkg that I can drop into a MVC4 app, connect to my RavenDb and be done. I'm willing to build this thing but don't want to duplicate any efforts that are already in motion. Thx!

Zedekiah answered 2/12, 2012 at 3:49 Comment(3)
I just ran into this article by Scott Allen, he goes though both EF and RavenDB membership. odetocode.com/blogs/scott/archive/2012/10/01/…Jolee
Have you got anywhere with your question? what did you end up using?Refresher
I forked github.com/OdeToCode/Memflex to suit my needs. Works pretty seemlessly. But I have heard there's another project (TBA) that will solve the same problem.Zedekiah
S
4

There are several ASP.Net membership providers for RavenDB. None of them are official, and they all have slightly different implementations. Google for "ravendb membership provider" and you will find many.

There is a good article here comparing a few of them with Raven's own authorization and authentication bundles.

I agree with you that it should be easier to swap out SQL for Raven on the various MVC4 templates. However, in addition to relying on the membership provider, they tend to have models that are designed to work with Entity Framework. If you were to write the sample templates from scratch with RavenDB in mind, you'd probably have a very different final product.

Update

I didn't realize you were talking about the new SimpleMembershipProvider. I wasn't aware this existed. I found Jon Galloway's article describing it in detail - a great read. He points out two key points that are relevant here. I quote:

Note that SimpleMembership still requires some flavor of SQL Server - it won't work with MySQL, NoSQL databases, etc. You can take a look at the code in WebMatrix.WebData.dll using a tool like ILSpy if you'd like to see why - there are places where SQL Server specific SQL statements are being executed, especially when creating and initializing tables. It seems like you might be able to work with another database if you created the tables separately, but I haven't tried it and it's not supported at this point.

...

The important thing to take away here is that a SimpleMembershipProvider is a MembershipProvider, but a MembershipProvider is not a SimpleMembershipProvider. This distinction is important in practice: you cannot use an existing MembershipProvider (including the Universal Providers found in System.Web.Providers) with an API that requires a SimpleMembershipProvider, including any of the calls in WebMatrix.WebData.WebSecurity or Microsoft.Web.WebPages.OAuth.OAuthWebSecurity.

I would gather then that writing a SimpleMembershipProvider for RavenDB would not be possible.

Singlefoot answered 2/12, 2012 at 17:1 Comment(5)
yes, I have googled "ravendb membership provider" and I find 1 or 2 other projects based on MVC3 and doesn't support OAuth, which is 50% of what I'm looking for. I am also aware of the RavenDb auth bundle, but that handles "system users", not what I'm looking for (app users). Thanks.Zedekiah
It seems like most people answer these questions about membership without knowledge of the new SimpleMembership provider.Asseveration
MemFlex (as I pointed out in my question) was built to support SimpleMembership for RavenDB. I was just looking for other solutions. FYI, someone sent me an email stating that there should be a "solution" for this soon, but they couldn't comment on details.Zedekiah
Shouldn't you be able to hide the WebSecurity and OAuthWebSecurity behind interfaces and then implement the methods yourself?Thrombus
I downloaded and used the solution MemFlex. It works out of the box like a charm. But can someone shed some light on the status of this project ? Can we trust this on a production system ? Is this code still being maintained ?Autoerotic
P
1

There's a new project that seems to neatly implement the AspNet.Identity using RavenDb http://www.tugberkugurlu.com/archive/aspnet-identity-ravendb--fully-asynchronous-new-and-sweet-asp-net-identity-implementation-for-ravendb

Paradies answered 13/1, 2014 at 20:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.