Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Authentication problem

 
Thread Tools Search this Thread
Old 10-18-2004, 07:31 PM   #1
Default 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




Nikolay Petrov
  Reply With Quote
Old 10-18-2004, 07:49 PM   #2
Nikolay Petrov
 
Posts: n/a
Default Re: Authentication problem

In Windows forms app

"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:...
> 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"
> <> 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
Old 10-18-2004, 07:49 PM   #3
Scott Allen
 
Posts: n/a
Default Re: Authentication problem

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"
<> 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
Old 10-18-2004, 07:59 PM   #4
Scott Allen
 
Posts: n/a
Default Re: Authentication problem

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"
<> 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
Old 10-18-2004, 08:11 PM   #5
Nikolay Petrov
 
Posts: n/a
Default Re: Authentication problem

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:...
> 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"
> <> 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
Old 10-19-2004, 12:36 PM   #6
Paul Glavich [MVP - ASP.NET]
 
Posts: n/a
Default Re: Authentication problem

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" <> wrote in message
news:%...
> 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
Old 10-19-2004, 01:25 PM   #7
Nikolay Petrov
 
Posts: n/a
Default Re: Authentication problem

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]" <-NOSPAM> wrote in
message news:%...
> 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" <> wrote in message
> news:%...
>> 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 Search this Thread
Search this Thread:

Advanced Search

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump