Wednesday, September 21, 2011

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="Spring Security Application

The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="Spring Security Application

We mostly get this error when trying to consume an authenticated webservice or a WCF service. I have a workaround for that. This worked for me so I believe it would be useful for you too. In the web.config file conside the SECURITY node. below is a sample.

<security mode="Transport">
                       
<transport clientCredentialType="Basic" proxyCredentialType="None" realm=""/>
                        <message clientCredentialType="UserName" algorithmSuite="Default"/>
                    </security>

Try changing the "clientCredentialType" for the "transport" node from "None" to "Basic". It should work. 

Happy coding to all............