简体   繁体   English

如何将asp.net成员资格提供程序添加到asp.net Web应用程序?

[英]How to add a asp.net membership provider to asp.net web application?

I am trying to figure this one out. 我试图弄清楚这一点。 I am using a simple web service that is hosted by an asp.net web application that is going to be used for authentication for a mobile client and a desktop client and it will also be used to send/receive information to and from the clients. 我正在使用由asp.net Web应用程序承载的简单Web服务,该应用程序将用于移动客户端和桌面客户端的身份验证,并且还将用于向客户端发送信息或从客户端接收信息。

Right now the service uses custom username and password authentication that is hard coded into the service. 现在,该服务使用硬编码到服务中的自定义用户名和密码身份验证。 I need some kind of authentication though. 我需要某种身份验证。 So I figured I could just add the asp.net membership provider to the web application that is hosting the service, and I could use that database for the members for the service. 因此,我认为可以将asp.net成员资格提供程序添加到承载该服务的Web应用程序中,并且可以将该数据库用作该服务的成员。

This would provide a way for me to manage the users as well. 这将为我提供一种管理用户的方式。 Could anyone tell me if this would work and if so how could it be implmented? 谁能告诉我这是否行得通,如何行之有效?

Here is the service I am using: http://www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti 这是我正在使用的服务: http : //www.codeproject.com/Articles/96028/WCF-Service-with-custom-username-password-authenti

It is easy to do. 这很容易做到。 Assuming you're using Visual Studio I suggest using the web site administration tool. 假设您使用的是Visual Studio,建议您使用网站管理工具。 A MSDN article describing adding ASP.NET Membership Provider can be found at http://msdn.microsoft.com/en-us/library/6e9y4s5t(v=vs.100).aspx 可以在http://msdn.microsoft.com/zh-cn/library/6e9y4s5t(v=vs.100).aspx上找到描述添加ASP.NET成员资格提供程序的MSDN文章。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM