Credentials and authentication

T

Tim Mavers

I am trying to figure out a way of including the crendentials of the user
that the ASP worker process is using (impersonating) in an HTTP request to
my web site.

Basically I have anonymous access disabled (using just basic
authentication). In my asp.net code I make a web request to my own site
asking for some data (sort of like a web service request). The problem is
that the request fails when anonymous access is disabled.

The only user that has access to this site is the user that the ASP.NET WP
is running as (which I configured in IIS Service Manager). Is there a way
to programatically grab the credentials of this user and pass it along in my
request?

Thanks,
 
B

bruce barker

you can if you use basic authenication. you have two options:

1) turn on impersonation in web config, and set the credials in the
webrequest to the current credentials

wc.Credentials = CredentialCache.DefaultCredentials

2) mime the http headers for the login and password (the password is just
base64 encoded), and fill in the credentials in the web request.

-- bruce(sqlwork.com)


| I am trying to figure out a way of including the crendentials of the user
| that the ASP worker process is using (impersonating) in an HTTP request to
| my web site.
|
| Basically I have anonymous access disabled (using just basic
| authentication). In my asp.net code I make a web request to my own site
| asking for some data (sort of like a web service request). The problem is
| that the request fails when anonymous access is disabled.
|
| The only user that has access to this site is the user that the ASP.NET WP
| is running as (which I configured in IIS Service Manager). Is there a way
| to programatically grab the credentials of this user and pass it along in
my
| request?
|
| Thanks,
|
|
 

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,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top