471,354 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Call to webservice doesn't pass in credentials

I'm making a call to a webservice from my ASP.NET page. The web
application has anonymous access turned off and Integrated Windows auth
turned on. The web.config has <identity impersonate=true>. I set the
credentials of the web service proxy to the DefaultCredentials. Right
before I make the call, I print out the WindowsIdentity, and it is
showing the right identity. So I know the web application is
authenticating properly. However, the call to the web service isn't
using those credentials. Looking at the IIS logs for the webservice,
it isn't passing in any credentials, so is returning a 401. The
web.config for the webservice has allow all users. And I can call the
webservice successfully from my development machine. It is just when I
run the web application on the QA box that it fails.

Is there anything I might be missing?

Thanks,
Carole

Nov 20 '05 #1
2 3982
Hi Carole,

Does your web.config of the web service contain the following line?
<authentication mode="Windows" />

Pass in a valid credential to your client proxy by doing this:

myWebService.Credentials = new System.Net.NetworkCredential("myUserName",
"myPassword", "myDomain");

and capture the credential at your service side by doing this (you already
have impersonation = true in web.config):

System.Security.Principal.WindowsIdentity.GetCurre nt().Name

or

System.Threading.Thread.CurrentPrincipal.Identity. Name

What do you see? Is it same as "myUserName"?

Thanks,
Ram

<el*****@yahoo.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I'm making a call to a webservice from my ASP.NET page. The web
application has anonymous access turned off and Integrated Windows auth
turned on. The web.config has <identity impersonate=true>. I set the
credentials of the web service proxy to the DefaultCredentials. Right
before I make the call, I print out the WindowsIdentity, and it is
showing the right identity. So I know the web application is
authenticating properly. However, the call to the web service isn't
using those credentials. Looking at the IIS logs for the webservice,
it isn't passing in any credentials, so is returning a 401. The
web.config for the webservice has allow all users. And I can call the
webservice successfully from my development machine. It is just when I
run the web application on the QA box that it fails.

Is there anything I might be missing?

Thanks,
Carole

Nov 20 '05 #2
standard nt security does not allow creditials forwarding (1 hop rule).
unless the website is hit from a local browser (like on your local dev box),
asp.net will not have login token it can use to access another server.

you will need to switch to Kerberos and turn on credentials forwarding.

http://support.microsoft.com/default...b;en-us;810572

-- bruce (sqlwork.com)
<el*****@yahoo.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
I'm making a call to a webservice from my ASP.NET page. The web
application has anonymous access turned off and Integrated Windows auth
turned on. The web.config has <identity impersonate=true>. I set the
credentials of the web service proxy to the DefaultCredentials. Right
before I make the call, I print out the WindowsIdentity, and it is
showing the right identity. So I know the web application is
authenticating properly. However, the call to the web service isn't
using those credentials. Looking at the IIS logs for the webservice,
it isn't passing in any credentials, so is returning a 401. The
web.config for the webservice has allow all users. And I can call the
webservice successfully from my development machine. It is just when I
run the web application on the QA box that it fails.

Is there anything I might be missing?

Thanks,
Carole

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Stephen | last post: by
6 posts views Thread by Davie | last post: by
2 posts views Thread by ALI-R | last post: by
5 posts views Thread by Daniel Wilson | last post: by
2 posts views Thread by Jay Balapa | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.