Using Default Credentails with HttpWebRequest

A

AtulSureka

Hi

I have a two virtual directories(say VD 1 & VD2) hosted on same web server.
Both are configured to use Windows NT authentication.

I hosted some web pages to VD1 and there is web service running on VD2.

I want to consume the web services (VD2) from the web pages (VD1). For that
I am using HttpWebRequest object.

I want to use default credential to consume the web services. For that I am
using System.Net.CredentialCache.DefaultCredentials property. With this I am
getting unauthorized 403 error.

If I explictly specify the credentials(using
NetworkCredential(uid,pwd,domain)) then it works.

Also in the browser if I first open VD1 page & then copy & paste the web
service URL then also it works. This means that browser is able to use the
same credentials to open VD2 web service.

Can anybody tell me how to use the credentials of VD1 to access web services
(VD2).

Atul Sureka
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top