wcf webhttp 身份验证
我正在使用 WCF Webhttp 服务。我已经创建了一堆服务,剩下的就是进行用户身份验证...
问题
与其余架构风格保持一致,我是否应该针对用户数据库对每个服务调用进行身份验证。 如果是这样,我应该通过在每次调用服务时提供凭据和密码来进行身份验证,并使用 SSL 保证其安全。基本上,每个 webget/webinvoke 函数都应包含用户凭据作为参数,并且我对每个调用进行身份验证。这是对的吗?这看起来效率相当低。
使用会话密钥在某种程度上似乎是错误的,但有任何关于如何在 WCF Webhttp 中使用会话的指示吗?
我不使用 ASP .net 会员资格(很快就会研究它),因为我使用 Mysql 并创建了自己的注册/用户数据库。我应该看看那个吗?我可以将 wcf 身份验证服务与 wcf webhttp 服务一起使用吗?
任何有关在 WCF webhttp 服务中处理身份验证的文献都会非常有帮助。
非常感谢
I am working with WCF Webhttp services. I have created a bunch of services and all that remains is to put in user authentication...
Questions
Keeping with the rest architecture style, should I authenticate each service call against the user db.
If so, I should just do authentication by supplying the credentials and password each time the service is called and make it secure with SSL. Basically, each webget/webinvoke function should contain the user credentials as parameters and I authenticate each call. Is this right? This seems rather inefficient.Using session key somehow seems wrong but any pointers as to how to use Session in WCF Webhttp?
I am not working with ASP .net membership (will be looking into it soon) since I was working with Mysql and have my own registration/user database created. Should I be looking at that? Can I use a wcf authentication service along with wcf webhttp services?
Any literature on handling authentication in WCF webhttp services would be greatly helpful.
Many thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看RESTful .NET一书的第8章(亚马逊,Google 图书 )
您将仅对来自用户的第一个调用进行身份验证,任何后续调用都将使用经过身份验证的用户的上下文。您可以通过多种方式使用 SSL(TLS),例如始终使用或仅在发送用户名/密码时使用。
我不确定您存储身份验证令牌的确切位置和方式(例如在会话或类似类型中)。
您不需要使用 ASP.NET 成员资格提供程序,事实上您可能根本不使用任何成员资格提供程序,只需使用其他身份验证模型即可。通常,每个服务只有一种身份验证模型,例如您获取凭据,根据持久存储检查它们,如果有效,则设置安全令牌,并且该令牌将在有限的时间内用于所有下一次调用。
You can check Chapter 8 of RESTful .NET book (Amazon, Google books)
You will authenticate only the first call from the user, any subsequent calls will use the context of the authenticated user. There are several options how you can use SSL(TLS), like always or just when you send username/password.
I am not sure where exactly and how you store the authentication token (like in Session or similar type).
You don't need to use ASP.NET membership provider, in fact you may not use any membership provider at all, just use other authentication models. Usually, there will be only one authentication model per service, like you get the credentials, check them against persisted storage, if valid you set the security token and that token is used for all the next calls for a limited amount of time.