开发者

Windows authentication with Silverlight custom binding

I am trying to set up security within a web.config file for a WCF service hosted in IIS but keep getting the error message:

Security settings for this service require 'Anonymous' Authentication but it is开发者_StackOverflow中文版 not enabled for the IIS application that hosts this service.

I have read Nicholas Allen’s blog (link text) and it appears that this is the route that I need to take. However, I am using “binaryMessageEncoding” in a customBinding for my Silverlight service, and as such, I’m not sure how to apply this type of security to such an element. This is how my custom binding looks in config at present:

<customBinding>             
  <binding name="silverlightBinaryBinding">          
    <binaryMessageEncoding />
    <httpTransport />
  </binding>
</customBinding>

Has anyone had any experience getting Windows authentication to work with a custom binding using binaryMessageEncoding?


<httpTransport authenticationScheme="Negotiate"/>

Works for me.

Make sure you use the same binding for your mex endpoint:

<bindings>
    <customBinding>
        <binding name="myCustomBinding">
            <binaryMessageEncoding maxSessionSize="2147483647">
                <readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" />
            </binaryMessageEncoding>
            <httpTransport maxReceivedMessageSize="4194304" authenticationScheme="Negotiate"/>
        </binding>
    </customBinding>
</bindings>
<services>
    <service name="Service">
        <endpoint address=""    binding="customBinding" bindingConfiguration="myCustomBinding" contract="IService" />
        <endpoint address="mex" binding="customBinding" bindingConfiguration="myCustomBinding" contract="IMetadataExchange" />
    </service>
</services>


I too got the same issue, i fixed it by making the following changes in the end point configuration

<httpTransport authenticationScheme="Ntlm"/>

and Remove the mex endpoint


The option of

<httpTransport authenticationScheme="IntegratedWindowsAuthentication"/>

works as well for this issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜