473,800 Members | 2,586 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Authentication problem

I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threadin g.Thread.Curren tPrincipal.Iden tity.Name
tmpArr(1) =
System.Threadin g.Thread.Curren tPrincipal.Iden tity.Authentica tionType.ToStri ng
tmpArr(2) =
System.Threadin g.Thread.Curren tPrincipal.Iden tity.IsAuthenti cated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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 1467
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.Credential s = System.Net.Cred entialCache.Def aultCredentials "

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_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threadi ng.Thread.Curre ntPrincipal.Ide ntity.Name
tmpArr(1) =
System.Threadi ng.Thread.Curre ntPrincipal.Ide ntity.Authentic ationType.ToStr ing
tmpArr(2) =
System.Threadi ng.Thread.Curre ntPrincipal.Ide ntity.IsAuthent icated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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.c om...
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.Credential s = System.Net.Cred entialCache.Def aultCredentials "

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_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Thread ing.Thread.Curr entPrincipal.Id entity.Name
tmpArr(1) =
System.Thread ing.Thread.Curr entPrincipal.Id entity.Authenti cationType.ToSt ring
tmpArr(2) =
System.Thread ing.Thread.Curr entPrincipal.Id entity.IsAuthen ticated.ToStrin g
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threadi ng.Thread.Curre ntPrincipal.Ide ntity.Name
tmpArr(1) =
System.Threadi ng.Thread.Curre ntPrincipal.Ide ntity.Authentic ationType.ToStr ing
tmpArr(2) =
System.Threadi ng.Thread.Curre ntPrincipal.Ide ntity.IsAuthent icated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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.c om...
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.Credential s = System.Net.Cred entialCache.Def aultCredentials "

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_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Thread ing.Thread.Curr entPrincipal.Id entity.Name
tmpArr(1) =
System.Thread ing.Thread.Curr entPrincipal.Id entity.Authenti cationType.ToSt ring
tmpArr(2) =
System.Thread ing.Thread.Curr entPrincipal.Id entity.IsAuthen ticated.ToStrin g
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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******** ********@TK2MSF TNGP15.phx.gbl. ..
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threadin g.Thread.Curren tPrincipal.Iden tity.Name
tmpArr(1) =
System.Threadin g.Thread.Curren tPrincipal.Iden tity.Authentica tionType.ToStri n
g tmpArr(2) =
System.Threadin g.Thread.Curren tPrincipal.Iden tity.IsAuthenti cated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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**@aspallian ce.com-NOSPAM> wrote in
message news:%2******** ********@TK2MSF TNGP09.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******** ********@TK2MSF TNGP15.phx.gbl. ..
I have the following web method:

<WebMethod()> _
Public Function Test_CurrentCre dentials() As String()
Dim tmpArr(2) As String
tmpArr(0) = "User: " &
System.Threadin g.Thread.Curren tPrincipal.Iden tity.Name
tmpArr(1) =

System.Threadin g.Thread.Curren tPrincipal.Iden tity.Authentica tionType.ToStri n
g
tmpArr(2) =
System.Threadin g.Thread.Curren tPrincipal.Iden tity.IsAuthenti cated.ToString
Return tmpArr
End Function

In my app I call it this way:
Dim tmpArr() as string
Dim svc As New WebReference.Se rvice1
svc.Credentials = System.Net.Cred entialCache.Def aultCredentials
tmpArr = svc.Test_Curren tCredentials

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
9292
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. # No warranty express or implied for the accuracy, fitness to purpose
5
673
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 web.config file is configured as such: <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" name="myApplication"/> </authentication>
4
1958
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, and i dont know why? i click cancel on it and the page still works as normal. How can i remove this, and why is it appearing? i am also not using any .NET authentication methods or anything..
5
2880
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 to manually authenticate users to provide acess My project has 2 web.config files... the default file <authentication mode="Forms"><forms loginUrl="Login.aspx" protection="All" timeout="30"...
4
2191
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 group set up on our domain. It seems to me I am missing something very simple and obvious, but none of the MSDN articles I have read are indicating what this might be. My setup is ASP.Net running on a Windows 2003/IIS 6 server. IIS security...
6
3350
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 to other apps without reenter UID/PWD. Everything works except it doesn't meet our security policy for new created users. When creating a new user, it's required to have "user must change password when first time login". In this case, the user will...
4
4663
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 is for security reason when accessing databases). We use the Integrated Windows authentication to authenticate users, and we have setup the Web.config file to authenticate those users against 3 NT Domain Global Groups. Everything is working fine...
3
1567
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 prohibit this dialog? Some information provides for you: 1) Dev softs: - VS 2005, ASP.NET 2.0, SQL Server 2005 Enterprise edition 2) Server:
2
7521
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 up as follows: Client Userid-Password Plugin (CLNT_PW_PLUGIN) = Client Kerberos Plugin (CLNT_KRB_PLUGIN) = Group Plugin (GROUP_PLUGIN) = GSS Plugin for Local Authorization ...
4
424
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: <configuration> <system.web> <customErrors mode="Off"/>
0
9691
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9551
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10279
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...
0
10036
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
9092
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
7582
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
5473
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...
0
5607
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3765
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.