Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Web Service Credentials - Access Denied

Reply
Thread Tools

Web Service Credentials - Access Denied

 
 
Stan
Guest
Posts: n/a
 
      12-08-2003
I am having problems passing the credentials from the
current user to the Web Service. THANK YOU in advance for
any help!!

Web Service and Web application are on different machines.
Anonymous logon is off and Inegrated Security on for both.
Impersonate is set to true.

Web application code ...
WebService MyWebService = new WebService();
//MyWebService.Credentials = new NetworkCredential
(UserName, PW, Domain);
MyWebService.DoWork();

Error: HTTP status 401: Access Denied.

If I uncomment the MyWebService.Credentials and hard code
the credentials then it works. But, I need to pass the
credentials of the current user.

I've tried just passing the Credential cache
MyWebService.Credentials = new System.Net.CredentialCache
();

I've tried using Digest authentication to no avail:
CredentialCache cache = new CredentialCache();
cache.Add( new Uri(MyWebService.Url), "Digest", new
NetworkCredential(UserName, password, domain));
MyWebService.Credentials = cache;

Thanks again for any help

 
Reply With Quote
 
 
 
 
maud_chiva
Guest
Posts: n/a
 
      12-08-2003
You must use the static method
MyWebService.Credentials =
CredentialCache.DefaultCredential;
in order to pass the current authenticated user
credential to the webservice.

See http://msdn.microsoft.com/library/default.asp?
url=/library/en-
us/cpguide/html/cpconusinginternetrequestresponseclasses.a
sp


>-----Original Message-----
>I am having problems passing the credentials from the
>current user to the Web Service. THANK YOU in advance

for
>any help!!
>
>Web Service and Web application are on different

machines.
>Anonymous logon is off and Inegrated Security on for

both.
>Impersonate is set to true.
>
>Web application code ...
>WebService MyWebService = new WebService();
>//MyWebService.Credentials = new NetworkCredential
>(UserName, PW, Domain);
>MyWebService.DoWork();
>
>Error: HTTP status 401: Access Denied.
>
>If I uncomment the MyWebService.Credentials and hard

code
>the credentials then it works. But, I need to pass the
>credentials of the current user.
>
>I've tried just passing the Credential cache
>MyWebService.Credentials = new System.Net.CredentialCache
>();
>
>I've tried using Digest authentication to no avail:
>CredentialCache cache = new CredentialCache();
>cache.Add( new Uri(MyWebService.Url), "Digest", new
>NetworkCredential(UserName, password, domain));
>MyWebService.Credentials = cache;
>
>Thanks again for any help
>
>.
>

 
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
"The credentials supplied conflict with an existing set of credentials" -=rjh=- NZ Computing 2 07-15-2006 11:09 PM
403 Forbidden: You were denied access because: Access denied by access control list Southern Kiwi NZ Computing 6 03-19-2006 05:19 AM
Web Service + Anon Access, but getting 401 Access Denied Error Alex Washtell via .NET 247 ASP .Net Web Services 1 04-05-2005 04:57 PM
Access Denied - Network Service vs Local Service mangia ASP .Net Security 3 09-27-2004 09:26 PM
Access Denied with Custom Credentials Homa ASP .Net Web Services 0 09-27-2004 07:53 PM



Advertisments