Reputation: 897
The authentication schemes configured on the host ('Anonymous') do not allow those configured on the binding 'BasicHttpBinding' ('Negotiate'). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly. Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.
Upvotes: 28
Views: 77129
Reputation: 6864
This was occurring for me as the site had WCF configured for Windows Authentication...
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
However IIS had Windows Authentication Disabled and Anonymous Authentication Enabled. The fix was to Enable Windows Authentication in IIS.
Upvotes: 2
Reputation: 2888
If you are trying to configure a service for 'Basic Authentication' in IIS (ie, it prompts for a username/password), then the security transport settings should be set as follows:
For basicHttpBinding
<security mode="Transport">
<transport clientCredentialType="Basic" />
<message clientCredentialType="UserName" />
</security>
For webHttpBinding
<security mode="Transport">
<transport clientCredentialType="Basic" />
</security>
Upvotes: 0
Reputation: 1239
In my case, the problem was in bad configuration of service after refactoring. If the name attribute in service tag does not point to existing class, you may get this exception, which will totaly mislead you.
So mind the name:
<service behaviorConfiguration="FooBehavior" name="Fully.Qualified.Name.Of.Class.Implementing.Service.Contract.Here">
Upvotes: 0
Reputation: 121
I solved this issue adding Negotiate to IIS Authentication Providers:
Upvotes: 2
Reputation: 967
If necessary - install features as described above, open IIS Manager, open the server features:
open the feature "Authentication":
enable/disable needed ones:
Upvotes: 15
Reputation: 1138
If you face this problem while debugging in Visual Studio, select your project and change authentication in properties.
Upvotes: 20
Reputation: 4051
When this happened to me, I found was that Visual Studio was using the 'Default Web Site' to host my service when adding the service reference using the 'Discover' button. So to fix, I had to enable the authentication my service was using on the 'Default Web Site' in IIS. Since I was using Windows Authentication, enabling it for the 'Default Website' in IIS and this seems to have fixed my problem. Of course if your service is using another type of auth, you will have to enable the correct authentication.
To configure the auth, open IIS. Under 'Sites', select the 'Default Web Site' and then Authentication.
Upvotes: 1
Reputation: 897
This error may be shown when you don't have authentication modes installed in your local IIS Webserver. Go to Control Panel -> Programs -> Turn Windows features on or Off
Check Internet Information services -> Wold wide web Services -> Security -> and enable Basic, Windows, Digest Authentication modes. Open IIS and navigate to your application and go to the authentication section and Enable the required authentication modes. For me the authentication modes didn't show up immediately after the installation or after webserver restart. Doing a machine reboot showed them in the webapplication.
Upvotes: 41