简体   繁体   中英

Authentication problem between ASP.Net Webforms app and a ASP.Net webservice

I got a ASP.Net webforms app which is using Forms authentication. It needs to authenticate against a webservice which uses windows authentication (+ impersonation).

I've tried (amongst other things) to supply credentials by using:

service.Credentials = new NetworkCredential(myUserName, thePassword, theDomain)

The problem is that I get 401 from the webservice no matter what I try.

I am doing exactly the same as this (by the sounds of it) and here is the way I construct the credentials.

var service = new MyService();
var netCredential = new NetworkCredential("user", "pwd", "domain");
var credentialCache = new CredentialCache
                          {
                              {new Uri(service.Url), "Basic", netCredential}
                          };
service.Credentials = credentialCache;

问题是不允许模拟运行Web服务的应用程序池的身份。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM