可以使用basichhtpbinding的哪种身份验证模式来保护使用Streaming的WCF服务? [英] Which authentication mode of basichhtpbinding can be used to secure a WCF Service using Streaming?

查看:19
本文介绍了可以使用basichhtpbinding的哪种身份验证模式来保护使用Streaming的WCF服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关我的服务的详细信息:

Details about my service:

  1. 文件上传服务
  2. 传输模式设置为流
  3. 服务托管在 IIS 7 中.

我需要为我的服务提供安全保障.我尝试过 ntlm 和 windows 安全.当我尝试保护我的服务时,我收到以下错误

I need to provide secuirty to my service. I have tried with ntlm and windows secuirty.I was getting the following error when i am trying to secure my service

HTTP 请求流不能与 HTTP 身份验证结合使用.禁用请求流或指定匿名 HTTP 身份验证."

"HTTP request streaming cannot be used in conjunction with HTTP authentication. Either disable request streaming or specify anonymous HTTP authentication."

我找到了一个描述,说明:说明:

I have found a description stating that: Description:

您不能进行传输身份验证.与流媒体.如果必须使用 HTTP 请求流,则必须在没有安全性的情况下运行.

You can't do transport auth. with streaming. If you have to use HTTP request streaming, you'll have to run without security.

所以我想知道如何确保我的服务?我可以将哪种安全模式与 basichttpbinding 一起使用?有人可以帮助我吗?

So i wish to know how can i secure my service? Which secuirty mode can i use with basichttpbinding?Can anyone pls help me on this?

推荐答案

你可以试试使用TransportWithMessageCredential:

<bindings>
  <basicHttpBinding>
    <binding name="securedStream" transferMode="streamed">
      <security mode="TransportWithMessageCredential">
        <message clientCredentialType="UserName" />
      </security>
    </binding>
  </basicHttpBinding>
</bindings>

这将在 SOAP 标头中传递凭据.现在您必须传递用户名和密码 - 默认验证是针对 Windows 帐户的,但您也可以使用成员资格提供程序或自定义密码验证程序.

This will pass credentials in SOAP header. Now you must either pass user's name and password - default validation is against Windows accounts but you can also use Membership provider or custom password validator.

如果您真的需要 NTLM 或 Windows,那么这意味着您正在同一网络/域中运行客户端和服务器.在这种情况下,请改用 Net.tcp.

If you really want NTLM or Windows then it means you are running both client and server in the same network / domain. In such case use Net.tcp instead.

这篇关于可以使用basichhtpbinding的哪种身份验证模式来保护使用Streaming的WCF服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆