Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Impersonate user for webservice status 401

Reply
Thread Tools

Impersonate user for webservice status 401

 
 
jacques@designfault.co.uk
Guest
Posts: n/a
 
      12-05-2006
I'm connecting to a web service from an asp.net page and trying to pass
the current asp.net page requesting user credentials to the web
service. My problem is a keep getting a 401 error from the web service,
when I check the log files of the server where the web service resides
I can see no user account details have been passed.

I have the web.config set as follows for the asp.net page consuming the
web service:

<authentication mode="Windows">
</authentication>
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
<identity impersonate="true"/>

When I check System.Threading.Thread.CurrentPrincipal.Identity. Name
before the web service call I see the username I'd expect.

I'm Setting the Web service credentials as follows:

WebService.Credentials = System.Net.CredentialCache.DefaultCredentials

>From what I have read from MSDN and from other group posts this should

work and the users Credentials should be passed to my web service but I
still get a 401 status back and I can see that no user details are
passed to my web service.

I'm starting to pull me hair out over this, any help to stop me going
bald would be very much appreciated!

Jacques.

 
Reply With Quote
 
 
 
 
Catalin T
Guest
Posts: n/a
 
      12-07-2006
Jacques,
Try this

WebService..PreAuthenticate=true;


Catalin


"" wrote:

> I'm connecting to a web service from an asp.net page and trying to pass
> the current asp.net page requesting user credentials to the web
> service. My problem is a keep getting a 401 error from the web service,
> when I check the log files of the server where the web service resides
> I can see no user account details have been passed.
>
> I have the web.config set as follows for the asp.net page consuming the
> web service:
>
> <authentication mode="Windows">
> </authentication>
> <authorization>
> <allow users="*" />
> <deny users="?" />
> </authorization>
> <identity impersonate="true"/>
>
> When I check System.Threading.Thread.CurrentPrincipal.Identity. Name
> before the web service call I see the username I'd expect.
>
> I'm Setting the Web service credentials as follows:
>
> WebService.Credentials = System.Net.CredentialCache.DefaultCredentials
>
> >From what I have read from MSDN and from other group posts this should

> work and the users Credentials should be passed to my web service but I
> still get a 401 status back and I can see that no user details are
> passed to my web service.
>
> I'm starting to pull me hair out over this, any help to stop me going
> bald would be very much appreciated!
>
> Jacques.
>
>

 
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
Security exception with impersonate true for a webservice KaNos ASP .Net 2 09-06-2006 08:25 AM
ASP.NET Webservice Impersonate problem Aras Kucinskas ASP .Net Security 0 08-31-2004 02:07 PM
ASP.NET Webservice Impersonate problem Aras Kucinskas ASP .Net 0 08-31-2004 02:07 PM
DirectoryEntry Impersonate or WindowsIdentity Impersonate? Bill Belliveau ASP .Net Security 3 01-31-2004 04:19 AM
HTTP Status 401 -- WebServer calling WebService Howard Hoffman ASP .Net Web Services 0 09-10-2003 12:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57