[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

WCF Windows Security

Posted on 2011-02-15
9
Medium Priority
?
564 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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

834 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