Solved

WCF Windows Security

Posted on 2011-02-15
9
533 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:dinudany
Comment Utility
0
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
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
Comment Utility
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
 
LVL 83

Expert Comment

by:CodeCruiser
Comment Utility
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 2

Author Comment

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

Author Comment

by:jimseiwert
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I am going to issue points to CodeCruiser for helping me find teh reight direction and past support on questions
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now