WCFTestClient The HTTP request is unauthorized with client authentication scheme 'Anonymous'

前端 未结 9 1465
囚心锁ツ
囚心锁ツ 2020-12-05 01:34

I\'ve created one WCF service and deployed it on Server. When I browse this service it gives me positive response with ?wsdl URL. Now I\'m trying to test the service through

9条回答
  •  再見小時候
    2020-12-05 02:13

    Here's what I had to do to get this working. This means:

    1. Custom UserNamePasswordValidator (no need for a Windows account, SQLServer or ActiveDirectory -- your UserNamePasswordValidator could have username & password hardcoded, or read it from a text file, MySQL or whatever).
    2. https
    3. IIS7
    4. .net 4.0

    My site is managed through DotNetPanel. It has 3 security options for virtual directories:

    1. Allow Anonymous Access
    2. Enable Basic Authentication
    3. Enable Integrated Windows Authentication

    Only "Allow Anonymous Access" is needed (although, that, by itself wasn't enough).

    Setting

    proxy.ClientCredentials.Windows.AllowedImpersonationLevel =  System.Security.Principal.TokenImpersonationLevel.Impersonation;
    

    Didn't make a difference in my case.

    However, using this binding worked:

          
            
            
                  
    

提交回复
热议问题