Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Authentication problem

Reply
Thread Tools

Authentication problem

 
 
Nikolay Petrov
Guest
Posts: n/a
 
      10-18-2004
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


 
Reply With Quote
 
 
 
 
Nikolay Petrov
Guest
Posts: n/a
 
      10-18-2004
In Windows forms app

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:(E-Mail Removed)...
> 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"
> <(E-Mail Removed)> 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
>>

>



 
Reply With Quote
 
 
 
 
Scott Allen
Guest
Posts: n/a
 
      10-18-2004
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"
<(E-Mail Removed)> 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
>


 
Reply With Quote
 
Scott Allen
Guest
Posts: n/a
 
      10-18-2004
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"
<(E-Mail Removed)> 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
>


 
Reply With Quote
 
Nikolay Petrov
Guest
Posts: n/a
 
      10-18-2004
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:(E-Mail Removed)...
> 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"
> <(E-Mail Removed)> 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
>>

>



 
Reply With Quote
 
Paul Glavich [MVP - ASP.NET]
Guest
Posts: n/a
 
      10-19-2004
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" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Nikolay Petrov
Guest
Posts: n/a
 
      10-19-2004
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]" <(E-Mail Removed)-NOSPAM> wrote in
message news:%(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
>> 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
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failed Authentication, Status "Unsupported Authentication Algorithm" Rafael Cisco 1 11-26-2004 03:57 PM
Basic Authentication v. Integrated Windows Authentication w/ Delegation Mark ASP .Net 0 01-20-2004 03:13 PM
ASP.Net Forms authentication with basic authentication popup Brett Porter ASP .Net 2 01-20-2004 02:17 PM
Moving from Baisc Authentication to Forms Authentication raj mandadi ASP .Net 0 12-22-2003 12:16 AM
Forms Authentication, external authentication server, & rerouting to orig. req. URL Andrew Connell ASP .Net 1 10-21-2003 05:41 PM



Advertisments