System.Web.Security可以导入到WCF项目中吗
我目前正在寻找创建一个新的启用 JSON 的 WCF 项目。身份验证后,我将为后续请求创建一个临时会话密钥。该密钥将存储在数据库表中,并用于验证处理数据的特定请求。这应该会减少对数据库的影响,因为表将被内存缓存以提高速度,并且避免在每个请求上发送完整的凭据。我应该解释一下,所有请求都必须有用户帐户的连接,一般的 API 密钥场景是不够的。
为了让奇迹发生,我想与网站共享相同的用户数据库,并且想使用 SqlMembershipProvider 类。我无法将凭据从网站传递到 WebService,因为该服务将从设备访问,并且认证系统要求无论如何都不可行。
是否可以将 System.Web.Security 命名空间导入到我的 WCF 项目中,或者我是否需要编写一个新的成员管理系统并使用它,以允许我在两个项目之间共享代码?
感谢您的帮助,
德雷
I'm currently looking to create a new JSON enabled WCF project. After authenticating I will create a temporary session key for subsequent requests. This key will be stored in a database table and used to validate specific requests to process data. This should reduce database impact as the table will be mem-cached for speed and will avoid sending full credentials on every request. I should explain that all requests must have the contect of the user account, a generci API-key scenario is not enough.
To make the magic happen I want to share the same user database as the website and would like to use the SqlMembershipProvider class(es). I can't pass credentials from the website to the WebService as the service will be accessed from devices and the certification system requirement is not feasible anyway.
Is it possible to import the System.Web.Security namespace into my WCF project or will I need to write a new membership management system and use that, allowing me to share code between my two projects?
Thanks for the help,
Dre
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我尝试导入名称空间时,该项目不存在该名称空间,尽管我检查过它的目标是 .NET 4 框架。就好像它没有看到或过滤掉名称空间一样。
今晚我将尝试从头开始创建一个新项目,看看是否有效。最糟糕的情况是,我什至可能会尝试从 VS2010 回滚到 VS2008 作为我的开发环境。
When I try to import the namespace it's not there for that project, even though Iv'e checked that it's targeting the .NET 4 framework. It's almost as though it's not seeing, or filtering out, the namespace.
I'm going to try creating a new project this evening from scratch and see if it's do the trick. Worst case, I may even try rolling back from VS2010 to VS2008 as my development environment.