PC Review


Reply
Thread Tools Rate Thread

Auth Problem

 
 
Nikolay Petrov
Guest
Posts: n/a
 
      19th Oct 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

The app is Windows Forms app.

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.
In my Web Service web.config file I have thi line:
<authentication mode="Windows" />
When Anonymous is Enabled I can connect to service.

I have auditing turned on and doesn't show nothing.
What is the problem?

Tia


 
Reply With Quote
 
 
 
 
Nikolay Petrov
Guest
Posts: n/a
 
      19th Oct 2004
Also with "Basic" Authentication everything works fine

"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.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
>
> The app is Windows Forms app.
>
> 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.
> In my Web Service web.config file I have thi line:
> <authentication mode="Windows" />
> When Anonymous is Enabled I can connect to service.
>
> I have auditing turned on and doesn't show nothing.
> What is the problem?
>
> Tia
>



 
Reply With Quote
 
Joe Kaplan \(MVP - ADSI\)
Guest
Posts: n/a
 
      19th Oct 2004
This sounds like a double hop issue to me then. You probably have an
impersonation token with WIA and a primary token with Basic. The
impersonation token can't make another machine hop, but the primary token
can.

The solution to this is usually to use delegation.

http://msdn.microsoft.com/vstudio/us...lementKerberos

Joe K.

"Nikolay Petrov" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Also with "Basic" Authentication everything works fine
>
> "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.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
>>
>> The app is Windows Forms app.
>>
>> 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.
>> In my Web Service web.config file I have thi line:
>> <authentication mode="Windows" />
>> When Anonymous is Enabled I can connect to service.
>>
>> I have auditing turned on and doesn't show nothing.
>> What is the problem?
>>
>> Tia
>>

>
>



 
Reply With Quote
 
=?Utf-8?B?VGVkIENhbGxhbmRlcg==?=
Guest
Posts: n/a
 
      19th Oct 2004
Is the app on the calling computer running as a domain user account? If not,
you might want to replace

svc.Credentials = System.Net.CredentialCache.DefaultCredentials

with:

Dim credentials=New NetworkCredential("domainuser", "password", "MYDOMAIN")
svc.Credentials=credentials




"Nikolay Petrov" wrote:

> Also with "Basic" Authentication everything works fine
>
> "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.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
> >
> > The app is Windows Forms app.
> >
> > 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.
> > In my Web Service web.config file I have thi line:
> > <authentication mode="Windows" />
> > When Anonymous is Enabled I can connect to service.
> >
> > I have auditing turned on and doesn't show nothing.
> > What is the problem?
> >
> > Tia
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Er 550 re auth. Auth enabled. Still cannot send pics or attach. =?Utf-8?B?cm9iYWtl?= Microsoft Outlook Discussion 1 19th Aug 2007 03:47 PM
Windows Auth, but Forms Auth for one page? =?Utf-8?B?ZGhucml2ZXJzaWRl?= Microsoft ASP .NET 1 8th Jan 2005 05:50 PM
Auth/Un-Auth DHCP Server Selection =?Utf-8?B?YW5keUBic3Q=?= Windows XP Security 1 17th Aug 2004 05:38 AM
Auth Mgr cannot save/open auth store on shared network drive Karl Microsoft Windows 2000 Active Directory 0 26th May 2004 05:29 PM
Configuring Windows Auth & Forms Auth in Asp.Net =?Utf-8?B?Q2hyaXMgTW9oYW4=?= Microsoft ASP .NET 0 28th Apr 2004 07:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:41 PM.