473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 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 4080
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stephen | last post by:
I'm experiencing a strange problem that has me baffled. I created a webservice with a webmethod that connects to a remote MS SQL Server. It works fine when connecting to one server (running SQL...
1
by: John Lee | last post by:
Hi, I have two web services and they are setup as "Integrated Windows Authentication" only and they are both assigned to application pool with Domain Account. I can use ws.Credentials =...
6
by: Davie | last post by:
I want to authorise a user of a web service by using the AuthHeaderValue for some reason I keep getting a null reference exception when I try to run the following code: It seems to work fine on a...
2
by: ALI-R | last post by:
Hi All, I have a webservice on a win 2003 server and I'm trying to call it from another win2003 server which is hosting my sharepoint portal server. I am trying to call that webservice from a...
5
by: Daniel Wilson | last post by:
I have a client who is trying to deploy a webservice I wrote. The web service reads a file on a file server and delivers information about it. The file needs to be inaccessible to the user of the...
6
by: utnemisis51 | last post by:
Hi, I'm trying to include some user credentials for accessing a remote webservice. The remote location requires that I use Basic authentication, which means, from browsing around, I need to...
1
by: ad | last post by:
When we new a web Service, the default in IIS is Allow Anonymous and Integrated Windows Authentication , we just use : WebService.webClass myWC= new WebService.webClass(); and then we can access...
2
by: Jay Balapa | last post by:
Hello, Win Forms app is able to connect to my webservice passing credentials as follows- myService.Credentials=System.Net.CredentialsCache.DefaultCredentials; Compact Framework does not...
0
by: francovincent | last post by:
I am creatting webservice proxy in C++ dll to consume a webservice. But i am not able to pass credentials to that . Can anyone help me on this? I am setting the url of the webservice with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.