473,783 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=tru e>. I set the
credentials of the web service proxy to the DefaultCredenti als. 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 4100
Hi Carole,

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

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

myWebService.Cr edentials = new System.Net.Netw orkCredential(" 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.Wind owsIdentity.Get Current().Name

or

System.Threadin g.Thread.Curren tPrincipal.Iden tity.Name

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

Thanks,
Ram

<el*****@yahoo. com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.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=tru e>. I set the
credentials of the web service proxy to the DefaultCredenti als. 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.goo glegroups.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=tru e>. I set the
credentials of the web service proxy to the DefaultCredenti als. 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
7920
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 Server 7). But it can't connect to another server (running SQL Server 2000). The SQLConnection.Open() call results in a long pause, then the error "could not connect to server". What's odd is that if I put the exact same SQLConnection code into a...
1
2795
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 = System.Net.CredentialCache.DefaultCredentials; (ws is a web service proxy request instance) to call the web service BUT this method does not work if I want to call another web service from one web service.
6
768
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 .NET Framework application, but just not on the .NET CF version. Can anyone suggest anything that might be wrong with the code? (I could post the app and webservice, but i was hoping that you might have noticed something from the supplied...
2
3581
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 webpart but I get this error which says : System.Net.WebException: The request failed with HTTP status 401: Unauthorized. at RSTreeWebPart.RSTree.reportsList() at RSTreeWebPart.RSTree.RenderWebPart(HtmlTextWriter output)
5
4745
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 webservice because it is intellectual property. This sounds easy. Just give the IUsr account on the web server, a 2003 server running IIS6, read rights to the files on the file server. Since no HTTP path will get to the file server, the user...
6
4410
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 include the user name and password in the HTTP header, but I'm not quite sure how to access the HTTP header that is sent with the webservice soap message request. Can anyone help?
1
4377
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 the WebService thought myWC But I find some time it will fail with Access denid, and I must must use: WebService.webClass myWC= new WebService.webClass(); myWC.PreAuthenticate = true; myWC.Credentials =...
2
1585
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 have a CredentialsCache class. Is there an alternate way of passing default credentials?
0
1280
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 webReference.Seturl() method. I suppose there should be something similar to this for passing credentials also. Thnaks in advance
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8968
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.