简体   繁体   English

在.NET Web应用程序中,如何在无需托管自己的SQL数据库的情况下实现成员资格?

[英]In a .NET web app, how can I implement Membership without having to host my own SQL database?

I'm using Amazon Web Services for nearly everything, including their SimpleDB flat database. 我几乎将Amazon Web Services用于所有内容,包括其SimpleDB平面数据库。 It's so nice, stable, reasonably safe, etc.. The moment I begin to add Membership to my web app in .NET, it feels like I have to start becoming a fully-fledged database administrator and backup and manage a SQL database. 它是如此的好,稳定,相当安全等等。从我开始向.NET中的Web应用程序添加成员身份的那一刻,感觉就像我必须开始成为一个成熟的数据库管理员,并备份和管理SQL数据库。

Is there any method for implementing username/password/login/password recovery features on my website without having to host, backup and manage a SQL server myself? 有什么方法可以在我的网站上实现用户名/密码/登录/密码恢复功能,而无需自己托管,备份和管理SQL Server?

Thank you! 谢谢!

---UPDATE---- Found this sample project on AWS that has the basic custom Memebership code. --- UPDATE ----在具有基本自定义Memebership代码的AWS上找到了此示例项目。 It's a great start: 这是一个很好的开始:

http://aws.amazon.com/articles/3592 http://aws.amazon.com/articles/3592

You need to implement custom membership provider. 您需要实现自定义成员资格提供程序。 Take a look at MSDN article - Implementing a Membership Provider and an article - Building Custom Providers for ASP.NET 2.0 Membership . 看一下MSDN文章- 实现成员资格提供程序和文章- 构建ASP.NET 2.0成员资格的自定义提供程序

By providing you own MembershipProvider you can abstract the data access. 通过提供您自己的MembershipProvider,您可以抽象化数据访问。

There are two steps for this. 为此,有两个步骤。

One. 一。 In web.config: 在web.config中:

 <membership defaultProvider="MyMembershipProvider">
 <providers>
 <clear/>
 <add name="MyMembershipProvider" type="Full.Name.MyMembershipProvider" 
 more options here/>
 </providers>
 </membership>

Two. 二。 The membership class. 会员等级。

 public sealed class MyMembershipProvider : MembershipProvider {
    //... much more here 
    //example method:
    public override bool ChangePassword(string username, string oldPwd, string newPwd)
    {
        //access simpleDb here
    }
 }

The good news is that you have to implement only the methods you use, eg if you do registration through other channels then you can get away with only implementing ChangePassword , ValidateUser and Initialize . 好消息是,您只需要实现所使用的方法即可,例如,如果您通过其他渠道进行注册,则只需实现ChangePasswordValidateUserInitialize即可

Have a look at How to: Sample Membership Provider Implementation (for the class code) and Sample Membership Provider Implementation (for the web.config bit). 看一看如何:示例成员资格提供者实现 (针对类代码)和示例成员资格提供者实现 (针对web.config位)。

有一个带有.net sdk的示例asp.net应用程序,其中包含一个示例simpledb成员资格提供程序类(petboard示例) http://aws.amazon.com/articles/3592

RSSBus provides a SimpleDB data provider (looks free for now): RSSBus提供了一个SimpleDB数据提供程序(目前免费):

http://www.rssbus.net/ado/amazon-simpledb/features.aspx http://www.rssbus.net/ado/amazon-simpledb/features.aspx

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我可以在自己的用户数据库中使用ASP.NET WebForms中的成员资格提供程序吗? 如果是这样,怎么办? - Can I use the Membership provider in ASP.NET WebForms with my own User database? If so, how? 如何使用我的计算机托管我自己的 SQL 服务器数据库? - How can I host my own SQL Server database with my computer? 如何在Visual Studio 2012中在自己的数据库中创建成员资格表 - How Can I Create Membership Tables In My Own Database in Visual Studio 2012 如何在空的成员资格表中创建自己的密码? - How I can create my own password in an empty membership table? 如何将SQL Server CE用于我的ASP.net MVC成员/授权项目? - How can I use SQL Server CE for my ASP.net MVC membership/authorization project? 如何配置我的 Net 6 web 应用程序,以便它知道我正在自己的机器上开发? - How do I configure my Net 6 web app so that it knows I'm developing on my own machine? 如何从具有自己的API(具有API Search EndPoint)的第三方数据库中加载数据,以使用我的Azure Web应用程序bot实施? - How do I load data from a third party database that has its own API (it has an API Search EndPoint) to implement with my azure web app bot? 我怎样才能实现自己的外部类型? - How can I implement my own type of extern? 如何在 IdentityServer4 中实现自己的 ClientStore? - How can I implement my own ClientStore in IdentityServer4? ASP.Net成员不访问我的Sql Server数据库 - ASP.Net Membership not accessing my Sql Server Database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM