473,396 Members | 2,002 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,396 software developers and data experts.

Authentication problem

I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia
Nov 18 '05 #1
6 1441
One way to troubleshoot is to turn on login auditing to see what
credentials are being presented by the code to the server. Perhaps
they are the credentials of a local account that the web server
cannot authenticate.

Too see steps to enable login auditing, see:
http://support.microsoft.com/kb/q185874/

Where does this line of code exist:

"svc.Credentials = System.Net.CredentialCache.DefaultCredentials"

Is it in a console application or ASP.NET application or ...?

--
Scott
http://www.OdeToCode.com/

On Mon, 18 Oct 2004 22:31:32 +0300, "Nikolay Petrov"
<jo******@mail.bg> wrote:
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity .Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity .AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity .IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia


Nov 18 '05 #2
In Windows forms app

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:j4********************************@4ax.com...
One way to troubleshoot is to turn on login auditing to see what
credentials are being presented by the code to the server. Perhaps
they are the credentials of a local account that the web server
cannot authenticate.

Too see steps to enable login auditing, see:
http://support.microsoft.com/kb/q185874/

Where does this line of code exist:

"svc.Credentials = System.Net.CredentialCache.DefaultCredentials"

Is it in a console application or ASP.NET application or ...?

--
Scott
http://www.OdeToCode.com/

On Mon, 18 Oct 2004 22:31:32 +0300, "Nikolay Petrov"
<jo******@mail.bg> wrote:
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identit y.Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identit y.AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identit y.IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia

Nov 18 '05 #3
Opps, ignore that link, it's out of date, apologies.

See:
Troubleshooting Security Issues
http://msdn.microsoft.com/library/de...SecNetch13.asp

and

Item 10: How to enable auditing
http://www.pluralsight.com/keith/boo...eauditing.html

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Mon, 18 Oct 2004 22:31:32 +0300, "Nikolay Petrov"
<jo******@mail.bg> wrote:
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity .Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity .AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity .IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia


Nov 18 '05 #4
I have turned on auditing before some time and I have allready checked the
event log. It's clear.
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:j4********************************@4ax.com...
One way to troubleshoot is to turn on login auditing to see what
credentials are being presented by the code to the server. Perhaps
they are the credentials of a local account that the web server
cannot authenticate.

Too see steps to enable login auditing, see:
http://support.microsoft.com/kb/q185874/

Where does this line of code exist:

"svc.Credentials = System.Net.CredentialCache.DefaultCredentials"

Is it in a console application or ASP.NET application or ...?

--
Scott
http://www.OdeToCode.com/

On Mon, 18 Oct 2004 22:31:32 +0300, "Nikolay Petrov"
<jo******@mail.bg> wrote:
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identit y.Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identit y.AuthenticationType.ToString
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identit y.IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia

Nov 18 '05 #5
Any firewalls in between? Does the client PC have any firewall installed?
Try disabling it if you do.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =
System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToStrin
g tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia

Nov 18 '05 #6
Everything is on my PC.
However I have found the cause for the problem.
I have disable HTTP keep alive, which is required for NTLM authntication to
run.

"Paul Glavich [MVP - ASP.NET]" <gl**@aspalliance.com-NOSPAM> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
Any firewalls in between? Does the client PC have any firewall installed?
Try disabling it if you do.

--
- Paul Glavich
Microsoft MVP - ASP.NET
"Nikolay Petrov" <jo******@mail.bg> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCredentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threading.Thread.CurrentPrincipal.Identity. Name
tmpArr(1) =

System.Threading.Thread.CurrentPrincipal.Identity. AuthenticationType.ToStrin
g
tmpArr(2) =
System.Threading.Thread.CurrentPrincipal.Identity. IsAuthenticated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Service1
svc.Credentials = System.Net.CredentialCache.DefaultCredentials
tmpArr = svc.Test_CurrentCredentials

When I run the app I get the following error:
The request failed with HTTP status 401: Access Denied
I have Disabled Anonymous authentication for my Web Service folder. Only
Integrated Windiows Authentication is active.

What is the problem?

Tia


Nov 18 '05 #7

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

Similar topics

7
by: Michael Foord | last post by:
#!/usr/bin/python -u # 15-09-04 # v1.0.0 # auth_example.py # A simple script manually demonstrating basic authentication. # Copyright Michael Foord # Free to use, modify and relicense. #...
5
by: Rob | last post by:
I have an ASP.NET application that uses forms-based authentication. A user wishes to be able to run multiple sessions of this application simultaneously from the user's client machine. The...
4
by: Paul M | last post by:
hi there, i've got a website i created, that i've put onto my test server on the web. I have a login page, that when the user comes to it, it first pops up a windows authentication dialog box,...
5
by: Gavin Stevens | last post by:
I'm trying to figure out the ASP.NET Forms Auth I have 3 or 4 pages i want to allow anonymous access to.. Then I have 5 or 6 pages I placed in another directory in the webproject. These I want...
4
by: Chris Gatto | last post by:
Hi, I'm having what should be a minor problem but has turned into a 2 day slug fest with ASP.Net. I am simply attempting to authenticate my asp.net application users against users in an AD...
6
by: Ming Zhang | last post by:
Hi guys, I have couple of ASP.NET applications that only support digest windows authentication, and credentials are managed in a central AD. When users login to one app, they can easily navigate...
4
by: pjdouillard | last post by:
Hello all, Here is the context of my problem: We have an ASP.NET 1.1 application that has its own application pool setup and that runs under the identity of a NT Domain service account (this...
3
by: KNC | last post by:
Hi all, I'm developing a website and deployed on webserver, it always display an authentication dialog that user must login with valid Windows user. Would anyone helps to instruct how to...
2
by: Frank Swarbrick | last post by:
I am trying to understand "client authentication" works. My environment is DB2/UDB LUW 8.2 on zSeries SLES9 as the database server and DB2 for VSE 7.4 as the client. We currently have DB2/LUW set...
4
by: =?Utf-8?B?R3V1czEyMw==?= | last post by:
Hi, I created a web site on a remote server. To logon the user must enter a user id and password. The site is uses Forms Authentication. The web config file looks as follows: ...
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: 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
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
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,...
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...
0
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...
0
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...
0
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,...

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.