Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The authentication schemes configured on the host ('Anonymous') do not allow those configured on the binding 'WebHttpBinding' ('Basic')

I was following the tutorial here: http://allen-conway-dotnet.blogspot.co.uk/2012/07/using-basic-authentication-in-rest.html?_sm_au_=iFVksVM0H8QrkntP, to implement User Authentication in WCF service but I get the following error:

The authentication schemes configured on the host ('Anonymous') do not allow those configured
 on the binding 'WebHttpBinding' ('Basic'). 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.

I did try disabling "Anonymous Authentication" in the project but then all I get is Error 401 - Unauthorized. No prompt to enter username and password ever shows up. Does anyone know why this problem might be occurring and how to fix it?

like image 765
Dawid O Avatar asked Sep 02 '14 14:09

Dawid O


1 Answers

I did finally manage to get rid of the problem by adding:

<behavior name="...">
     ...
     <serviceAuthenticationManager authenticationSchemes="Basic"/>
     ...
</behavior>
like image 102
Dawid O Avatar answered Sep 30 '22 17:09

Dawid O