但是…我已经开始使用RavenDb(在RavenHQ上为我的项目很多).所以,我开始尝试根据ExtendedMembershipProvider实现我自己的“定制会员提供者”,而在这样做时,我意识到没有什么意义.
我后来偶然发现了两个有趣的项目,试图解决这个确切的问题:
> WorldDomination.Web.Auth:https://github.com/PureKrome/WorldDomination.Web.Authentication
> MemFlex:https://github.com/OdeToCode/Memflex
两者都是最近有意思的努力,并且想知道这些是否是目前唯一正在建造的.我基本上正在寻找nuget pkg,我可以放入一个MVC4应用程序,连接到我的RavenDb并完成.我愿意建立这个东西,但不想重复已经运行的任何努力.
谢谢!
解决方法
有一个很好的文章here比较其中一些与Raven自己的授权和身份验证包.
我同意你应该更容易地在各种MVC4模板上交换出Raven的sql.但是,除了依赖成员资格提供商之外,他们也倾向于拥有旨在与实体框架一起工作的模型.如果你想从头开始用RavenDB编写示例模板,你可能会有一个非常不同的最终产品.
更新
我没有意识到你在谈论新的SimpleMembershipProvider.我不知道这是存在的.我发现Jon Galloway’s article详细描述 – 一个伟大的阅读.他指出了两个相关的要点.我引用:
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.
我会收集,那么为RavenDB编写一个SimpleMembershipProvider是不可能的.