473,386 Members | 1,785 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.

Problem with web service credentials

I have a ASP.NET web page that calls a web service on a server with IIS
installed on it. When it calls the web service, it gives a HTTP status 401
error stating that it is unauthorized to call the web service. After
searching the Microsoft Knowledge Base, article ID 811318 describes my exact
problem. However, when I try to implement the stated solution, I still
receive the same error.

Basically if I add the following line of code, it should fix my problem but
it doesn't.

WebService.credentials=system.net.credentialcache. defaultcredentials
(where WebService is a reference to the web service on the server)

I checked the directory security of the web service in IIS and anonymous
access has been turned off and Integrated Windows authentication has been
switched on.

Any help would be greatly appreciated.

Thanks.
May 17 '07 #1
4 7902
Hello,

I guess you have impersonation turned on in you website and the webservice
is on another computer.

In this case, you are using the credential from the client and pass it along
to the webservice. This breaks with NTLM authentication.

You have two options then:
- Implement Kerberos authentication (see
http://dunnry.com/blog/ConfiguringKe...legation.aspx).
- Turn off Windows authentication and use basic authentication. But you
should do this only if you are protecting the website with SSL.
Additionally, this will remove the single-sign-on experiences for the end
users.

Best regards,
Henning Krause

"Takumi" <Ta****@discussions.microsoft.comwrote in message
news:BF**********************************@microsof t.com...
>I have a ASP.NET web page that calls a web service on a server with IIS
installed on it. When it calls the web service, it gives a HTTP status 401
error stating that it is unauthorized to call the web service. After
searching the Microsoft Knowledge Base, article ID 811318 describes my
exact
problem. However, when I try to implement the stated solution, I still
receive the same error.

Basically if I add the following line of code, it should fix my problem
but
it doesn't.

WebService.credentials=system.net.credentialcache. defaultcredentials
(where WebService is a reference to the web service on the server)

I checked the directory security of the web service in IIS and anonymous
access has been turned off and Integrated Windows authentication has been
switched on.

Any help would be greatly appreciated.

Thanks.
May 17 '07 #2
Hello Henning,

Thanks for your reply. I looked at the website where it describes how to set
up kerberos delegation and have discovered that we already have it
implemented. I also checked the web.config files in the .NET application and
they are all set to impersonate=true and are running under a domain account.
I'm not sure what much more there is to check. Hope you can shed some more
light on this issue.

Thanks.

"Henning Krause [MVP - Exchange]" wrote:
Hello,

I guess you have impersonation turned on in you website and the webservice
is on another computer.

In this case, you are using the credential from the client and pass it along
to the webservice. This breaks with NTLM authentication.

You have two options then:
- Implement Kerberos authentication (see
http://dunnry.com/blog/ConfiguringKe...legation.aspx).
- Turn off Windows authentication and use basic authentication. But you
should do this only if you are protecting the website with SSL.
Additionally, this will remove the single-sign-on experiences for the end
users.

Best regards,
Henning Krause

"Takumi" <Ta****@discussions.microsoft.comwrote in message
news:BF**********************************@microsof t.com...
I have a ASP.NET web page that calls a web service on a server with IIS
installed on it. When it calls the web service, it gives a HTTP status 401
error stating that it is unauthorized to call the web service. After
searching the Microsoft Knowledge Base, article ID 811318 describes my
exact
problem. However, when I try to implement the stated solution, I still
receive the same error.

Basically if I add the following line of code, it should fix my problem
but
it doesn't.

WebService.credentials=system.net.credentialcache. defaultcredentials
(where WebService is a reference to the web service on the server)

I checked the directory security of the web service in IIS and anonymous
access has been turned off and Integrated Windows authentication has been
switched on.

Any help would be greatly appreciated.

Thanks.

May 17 '07 #3
Hello,

have you checked the service principal names? Are they all set correct?

Are there any duplicates in the list of service principal names?

Here is another link with troubleshooting tips on kerberos:
http://www.microsoft.com/technet/pro.../tkerberr.mspx

Best regards,
Henning Krause
"Takumi" <Ta****@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
Hello Henning,

Thanks for your reply. I looked at the website where it describes how to
set
up kerberos delegation and have discovered that we already have it
implemented. I also checked the web.config files in the .NET application
and
they are all set to impersonate=true and are running under a domain
account.
I'm not sure what much more there is to check. Hope you can shed some more
light on this issue.

Thanks.

"Henning Krause [MVP - Exchange]" wrote:
>Hello,

I guess you have impersonation turned on in you website and the
webservice
is on another computer.

In this case, you are using the credential from the client and pass it
along
to the webservice. This breaks with NTLM authentication.

You have two options then:
- Implement Kerberos authentication (see
http://dunnry.com/blog/ConfiguringKe...legation.aspx).
- Turn off Windows authentication and use basic authentication. But you
should do this only if you are protecting the website with SSL.
Additionally, this will remove the single-sign-on experiences for the end
users.

Best regards,
Henning Krause

"Takumi" <Ta****@discussions.microsoft.comwrote in message
news:BF**********************************@microso ft.com...
>I have a ASP.NET web page that calls a web service on a server with IIS
installed on it. When it calls the web service, it gives a HTTP status
401
error stating that it is unauthorized to call the web service. After
searching the Microsoft Knowledge Base, article ID 811318 describes my
exact
problem. However, when I try to implement the stated solution, I still
receive the same error.

Basically if I add the following line of code, it should fix my problem
but
it doesn't.

WebService.credentials=system.net.credentialcache. defaultcredentials
(where WebService is a reference to the web service on the server)

I checked the directory security of the web service in IIS and
anonymous
access has been turned off and Integrated Windows authentication has
been
switched on.

Any help would be greatly appreciated.

Thanks.

May 17 '07 #4
Hi Henning,

I've been able to get the web service to work but I really don't understand
it. I simply changed my project type in Visual Studio 2005 from a web site
type to a web application type and it worked. Apparently, there is a
difference between these 2 types but I'm not sure what. I am guessing that
either type should be able to communicate with a web service but so far I
can't figure out why a web site in VS 2005 has so much trouble talking to the
web service while a web application is so seamless.

Thanks.

"Henning Krause [MVP - Exchange]" wrote:
Hello,

have you checked the service principal names? Are they all set correct?

Are there any duplicates in the list of service principal names?

Here is another link with troubleshooting tips on kerberos:
http://www.microsoft.com/technet/pro.../tkerberr.mspx

Best regards,
Henning Krause
"Takumi" <Ta****@discussions.microsoft.comwrote in message
news:3C**********************************@microsof t.com...
Hello Henning,

Thanks for your reply. I looked at the website where it describes how to
set
up kerberos delegation and have discovered that we already have it
implemented. I also checked the web.config files in the .NET application
and
they are all set to impersonate=true and are running under a domain
account.
I'm not sure what much more there is to check. Hope you can shed some more
light on this issue.

Thanks.

"Henning Krause [MVP - Exchange]" wrote:
Hello,

I guess you have impersonation turned on in you website and the
webservice
is on another computer.

In this case, you are using the credential from the client and pass it
along
to the webservice. This breaks with NTLM authentication.

You have two options then:
- Implement Kerberos authentication (see
http://dunnry.com/blog/ConfiguringKe...legation.aspx).
- Turn off Windows authentication and use basic authentication. But you
should do this only if you are protecting the website with SSL.
Additionally, this will remove the single-sign-on experiences for the end
users.

Best regards,
Henning Krause

"Takumi" <Ta****@discussions.microsoft.comwrote in message
news:BF**********************************@microsof t.com...
I have a ASP.NET web page that calls a web service on a server with IIS
installed on it. When it calls the web service, it gives a HTTP status
401
error stating that it is unauthorized to call the web service. After
searching the Microsoft Knowledge Base, article ID 811318 describes my
exact
problem. However, when I try to implement the stated solution, I still
receive the same error.

Basically if I add the following line of code, it should fix my problem
but
it doesn't.

WebService.credentials=system.net.credentialcache. defaultcredentials
(where WebService is a reference to the web service on the server)

I checked the directory security of the web service in IIS and
anonymous
access has been turned off and Integrated Windows authentication has
been
switched on.

Any help would be greatly appreciated.

Thanks.


May 18 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ian | last post by:
Can anyone help I have a web server on the internet with and ASP.NET application on it, the application is set to allow Anonymous Access and Integrated Windows. The Web.config is set to use...
15
by: Ron L | last post by:
We are working on a distributed VB.Net application which will access a SQL database located on a known server. Each client will run on the user's local machine. To implement this, we are trying...
9
by: Ed Gonen | last post by:
Hi, I have the following problem. I've created 2 WebServices (A and B) that reference to the same assembly - Credentials. Each WebService (A and B) expose method GetCredentials that returns the...
0
by: Steve DeLong | last post by:
I have a C# Web Service (anonymous access has been disabled) that I would like to connect to with a standard Windows Service, also in C# as part of a scheduled synchronization system. I have...
2
by: David R | last post by:
I am writing a .NET web services client that is calling an Axis web service. I have two questions. 1. The following code should set the authentication; when I call a method on the web service,...
3
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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,...

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.