WCF - Soap Webservice with Basic Auth, no ssl, self-hosted

≯℡__Kan透↙ 提交于 2019-12-11 07:56:03

问题


I'm fully aware of the insecurity of this approach, but have a justified need for Basic http authentication for a WCF hosted SOAP webservice. Is there really no way to make this work? Every method I've found of adding basic auth requires transport (https) security.


回答1:


I think you're looking for "TransportCredentialOnly". See this MSDN article.

The binding would then look like this:

<bindings>
    <basicHttpBinding>
        <binding name="NewBinding">
            <security mode="TransportCredentialOnly">
                <transport clientCredentialType="Basic" />
            </security>
        </binding>
    </basicHttpBinding>
</bindings>

The above code snippet was taken from this blog article on the topic.



来源:https://stackoverflow.com/questions/7788254/wcf-soap-webservice-with-basic-auth-no-ssl-self-hosted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!