Solved

WCF Windows Security

Posted on 2011-02-15
9
538 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
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
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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:…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

863 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

20 Experts available now in Live!

Get 1:1 Help Now