Solved

WCF Windows Security

Posted on 2011-02-15
9
550 Views
Last Modified: 2012-05-11
I am trying to enable Windows security instead of Anonymous"Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service."

Can anyone see the problem with my web.config. Please dont send me just a link as i have viewed many examples and I am at a lost.

Thanks In Advance
<authentication mode="Windows"/>

<system.serviceModel>
   <extensions>
     <behaviorExtensions>
       <add name="silverlightFaults"
          type="SNC.FaultHanding.SilverlightFaultBehavior, SNC.FaultHanding, Version=1.0.0.0, Culture=neutral"/>
     </behaviorExtensions>
   </extensions>
   <behaviors>
     <endpointBehaviors>
       <behavior name="SilverlightFaultBehavior">
         <silverlightFaults/>
       </behavior>
     </endpointBehaviors>
     <serviceBehaviors>
       <behavior name="">
         <serviceMetadata httpGetEnabled="true" />
         <serviceDebug includeExceptionDetailInFaults="true" />
       </behavior>
     </serviceBehaviors>
   </behaviors>
   <bindings>
     <basicHttpBinding>
       <binding name="BasicHttpEndpointBinding">
         <security mode="TransportCredentialOnly">
           <transport clientCredentialType="Windows" />
         </security>
       </binding>
     </basicHttpBinding>
     <customBinding>
       <binding name="Web.Shipping.User_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Shipment_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport  />
       </binding>
       <binding name="Web.Shipping.Projects_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Carrier_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Administration_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Accounting_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
     </customBinding>
   </bindings>
  <serviceHostingEnvironment  aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
   <services>
     <service name="Web.Shipping.User_Service">
       <endpoint address=""
     binding="basicHttpBinding"
     contract="Web.Shipping.User_Service"
     behaviorConfiguration="SilverlightFaultBehavior" />
       <endpoint binding="basicHttpBinding"
     contract="IMetadataExchange"
     behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>

     <service name="Web.Shipping.Shipment_Service">
       <endpoint address=""
     binding="basicHttpBinding"
     contract="Web.Shipping.Shipment_Service"
     behaviorConfiguration="SilverlightFaultBehavior" />
       <endpoint binding="basicHttpBinding"
     contract="IMetadataExchange"
     behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>

     <service name="Web.Shipping.Projects_Service">
       <endpoint address=""
     binding="basicHttpBinding"
     contract="Web.Shipping.Projects_Service"
     behaviorConfiguration="SilverlightFaultBehavior" />
       <endpoint binding="basicHttpBinding"
     contract="IMetadataExchange"
     behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>

     <service name="Web.Shipping.Carrier_Service">
       <endpoint address=""
     binding="basicHttpBinding"
     contract="Web.Shipping.Carrier_Service"
     behaviorConfiguration="SilverlightFaultBehavior" />
       <endpoint binding="basicHttpBinding"
     contract="IMetadataExchange"
     behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>

     <service name="Web.Shipping.Administration_Service">
       <endpoint address=""
     binding="basicHttpBinding"
     contract="Web.Shipping.Administration_Service"
     behaviorConfiguration="SilverlightFaultBehavior" />
       <endpoint binding="basicHttpBinding"
     contract="IMetadataExchange"
     behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>

     <service name="Web.Shipping.Accounting_Service">
       <endpoint address=""
     binding="basicHttpBinding"
     contract="Web.Shipping.Accounting_Service"
     behaviorConfiguration="SilverlightFaultBehavior" />
       <endpoint binding="basicHttpBinding"
     contract="IMetadataExchange"
     behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>
   </services>
 </system.serviceModel>

Open in new window

0
Comment
Question by:jimseiwert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 2

Expert Comment

by:Dinesh Subramanian
ID: 34903919
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34906124
Have you configured the IIS? Check step 4 here

http://msdn.microsoft.com/en-us/library/ff648505.aspx


Have to post links because web.config is not the only piece in this puzzle.
0
 
LVL 2

Author Comment

by:jimseiwert
ID: 34906405
I did already have iis configured correctly. I added the transport method but still get the error when I browse to the service in IE "Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service. "
0
Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34906508
Try the suggestion

"Replace "bindingName" with "bindingConfiguration""

from this link

http://stackoverflow.com/questions/219151/iis-hosted-wcf-service-windows-auth-in-iis-transportcredentialonly-windows-au


You would have to change the Service tag.
0
 
LVL 2

Author Comment

by:jimseiwert
ID: 34906586
I don't have the word "bindingname" anywhere in my config file
0
 
LVL 2

Author Comment

by:jimseiwert
ID: 34906881
Here was the final working solution. Thank you for your help. The issue was with the custom configurations. I had to remove that along with the second binding for each service.
<bindings>
     <basicHttpBinding>
       <binding name="BasicHttpEndpointBinding">
         <security mode="TransportCredentialOnly">
           <transport clientCredentialType="Windows" proxyCredentialType="Windows" />
         </security>
       </binding>
     </basicHttpBinding>
   </bindings>
  <serviceHostingEnvironment  aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
   <services>
     <service name="Web.Shipping.User_Service">
       <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.User_Service" behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>
     <service name="Web.Shipping.Shipment_Service">
       <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.Shipment_Service" behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>
     <service name="Web.Shipping.Projects_Service">
       <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.Projects_Service"  behaviorConfiguration="SilverlightFaultBehavior"/>
    </service>
     <service name="Web.Shipping.Carrier_Service">
       <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.Carrier_Service" behaviorConfiguration="SilverlightFaultBehavior"/>
    </service>
     <service name="Web.Shipping.Administration_Service">
       <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.Administration_Service" behaviorConfiguration="SilverlightFaultBehavior"/>
    </service>
     <service name="Web.Shipping.Accounting_Service">
       <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.Accounting_Service" behaviorConfiguration="SilverlightFaultBehavior"/>
     </service>
   </services>
 </system.serviceModel>

Open in new window

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 34907262
Your original EndPoint tag was

<endpoint address="" binding="basicHttpBinding" contract="Web.Shipping.User_Service" behaviorConfiguration="SilverlightFaultBehavior" />


Your new endpoint tag is


<endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpEndpointBinding" contract="Web.Shipping.User_Service" behaviorConfiguration="SilverlightFaultBehavior"/>


So I do see that you have added the BindingConfiguration attribute now. Does it work if you remove it?
0
 
LVL 2

Author Comment

by:jimseiwert
ID: 34907294
Yes it works without it as well. The issue was with the section below. Once I removed that and fixed my bindings it worked
<customBinding>
       <binding name="Web.Shipping.User_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Shipment_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport  />
       </binding>
       <binding name="Web.Shipping.Projects_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Carrier_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Administration_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
       <binding name="Web.Shipping.Accounting_Service.customBinding0">
         <binaryMessageEncoding />
         <httpTransport />
       </binding>
     </customBinding>

Open in new window

0
 
LVL 2

Author Comment

by:jimseiwert
ID: 34907309
I am going to issue points to CodeCruiser for helping me find teh reight direction and past support on questions
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question