Hi,
I've got strange error on computer which is accessing web-service thrugh proxy.
Scenario 1
----------
- the web-service does not require authentication (Anonymous access is allowed)
- client works fine
Scenario 2
----------
- web-service requires authentication (Intergrated Win. auth / Basic auth.)
- client fails on 401 : Access Denied even though correct credentials are supplied
Scenario 3
----------
- same as Scenario 2, but from client who's not using proxy
- client works fine
It seems as if just the combination of proxy & site which requires authentication was creating the problem.
I tried everything, wirh with default proxy (System.Net.Get DefaultProxy), create my own, pass credentials using just NetworkCredenti als, using CredentialsCach e... Nothing helped so far.
This is sample code:
// --- my web-service proxy
ProbePX wspx = new ProbePX();
// --- setting up the proxy
wspx.Proxy = System.Net.WebP roxy.GetDefault Proxy();
wspx.Proxy.Cred entials = System.Net.Cred entialCache.Def aultCredentials ;
//wspx.Proxy.Cred entials = new System.Net.Netw orkCredential( txtPxUser.Text, txtPxPwd.Text, txtPxDomain.Tex t );
// --- setting up the credentials for the web-service
System.Net.Cred entialCache cache = new System.Net.Cred entialCache();
cache.Add(new Uri(wspx.Url), "Negotiate" , new System.Net.Netw orkCredential( txtAuthUser.Tex t, txtAuthPwd.Text , txtAuthDomain.T ext ));
wspx.Credential s = cache;
--
Vlad
I've got strange error on computer which is accessing web-service thrugh proxy.
Scenario 1
----------
- the web-service does not require authentication (Anonymous access is allowed)
- client works fine
Scenario 2
----------
- web-service requires authentication (Intergrated Win. auth / Basic auth.)
- client fails on 401 : Access Denied even though correct credentials are supplied
Scenario 3
----------
- same as Scenario 2, but from client who's not using proxy
- client works fine
It seems as if just the combination of proxy & site which requires authentication was creating the problem.
I tried everything, wirh with default proxy (System.Net.Get DefaultProxy), create my own, pass credentials using just NetworkCredenti als, using CredentialsCach e... Nothing helped so far.
This is sample code:
// --- my web-service proxy
ProbePX wspx = new ProbePX();
// --- setting up the proxy
wspx.Proxy = System.Net.WebP roxy.GetDefault Proxy();
wspx.Proxy.Cred entials = System.Net.Cred entialCache.Def aultCredentials ;
//wspx.Proxy.Cred entials = new System.Net.Netw orkCredential( txtPxUser.Text, txtPxPwd.Text, txtPxDomain.Tex t );
// --- setting up the credentials for the web-service
System.Net.Cred entialCache cache = new System.Net.Cred entialCache();
cache.Add(new Uri(wspx.Url), "Negotiate" , new System.Net.Netw orkCredential( txtAuthUser.Tex t, txtAuthPwd.Text , txtAuthDomain.T ext ));
wspx.Credential s = cache;
--
Vlad
Comment