The caller is not authenticated by the Service

Source: Internet
Author: User

I have been working on both the WCF Service and client on one computer. I called it on another computer today and found a new problem: "The caller is not authenticated by the Service ",

I checked a lot of information on the Internet, and did not find anyone explaining the reasons. I just found a solution, but I personally feel that it is not the best solution, so we are still exploring.

As mentioned in the solution, you can set the security authentication to "NONE" on the server and the client respectively. You have tried it several times and it has not been successful. but theoretically it is okay.

 

In addition, I found a solution. I don't know if I have any other opinions.

Deploying the WCF server and client on different machines separately may trigger the following exceptions.
System. servicemodel. Security. securitynegotiationexception not handled
Message = "the server has rejected client creden. "
Source = "mscorlib"
The solution is to adjust the server binding security mode, for example, set it to "NONE ".
Nettcpbinding binding = new nettcpbinding ();
Binding. Security. mode = securitymode. None;

Servicehost host = new servicehost (typeof (myservice ));
Host. addserviceendpoint (typeof (iservice), binding, "net. TCP: // 192.168.0.112: 8081 ");

Servicemetadatabehavior metadata = new servicemetadatabehavior ();
Metadata. httpgeturl = new uri ("http: // 192.168.0.112: 8080 ");
Metadata. httpgetenabled = true;
Host. description. behaviors. Add (metadata );

Host. open ();
Or set it in the configuration file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.