Access Denied with Custom Credentials

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Homa (homaneag_at_yahoo.com)
Date: 09/27/04

  • Next message: bruce barker: "Re: Memory leak in IE javascript with webservice.htc"
    Date: 27 Sep 2004 12:53:48 -0700
    
    

    Hi all,
      I'm exploring how to make authentication works with WebService.

    I've setup the WebService with no anonymous access and using
    Integrated Windows authentication.

    In my web-app or win-app, if I set the Credentials to
    System.Net.CredentialCache.DefaultCredentials, it runs fine.

    But since I want to identify my caller, I try to do the following:

    <code>
    (using System.Net;)

    CredentialCache cache = new CredentialCache();
    cache.Add(new Uri(myWebServiceProxy.Url), "Negotiate",
              new NetworkCredential("myUsername", "myPassword"));
    myWebServiceProxy.Credentials = cache;
    </code>

    And now I get Access Denied.
    I tried to use admin's username/password, ASPNET/myStrongPassword.

    Am I doing it the right way? What have I missed?

    Information:
    In machine.config, I set processModel with username="machine",
    password="myStrongPassword"

    When I look at the debugger, the DefaultCredentials contains the
    SystemNetworkCredential with username/password/domain == "" (m_xxx =
    undefined).

    I'm trying to follow the suggestion from the book "Building Secure
    Microsoft ASP.NET Applications - Authenticaion, Authorization, and
    Secure Communication -- patters & practices" from Microsoft Press,
    page 240.

    Thanks for concern,
    Homa Wong


  • Next message: bruce barker: "Re: Memory leak in IE javascript with webservice.htc"

    Relevant Pages

    • Re: HTTP Statuscode 401 (unauthorized) when accessing secured webservice
      ... The 3rd party webservice is hosted on linux. ... Using the CredentialCache to specify basic authentication didn't help. ... you can use CredentialCache class to construct client credentials and specify authenticaiton type. ... We welcome your comments and suggestions about how we can improve the support we provide to you. ...
      (microsoft.public.dotnet.framework.webservices)
    • 401 Error Webservice. I WANT anonymous access
      ... ASP.net Webservice ... IIS ... Anonymous access works on my other webserver, ... No failure audits appear, because no authentication ...
      (microsoft.public.dotnet.framework.aspnet.webservices)
    • RE: Save IE password thorugh group policy
      ... that web site, this remote cookie will pickup the password so that the users ... You can configure IIS to Anonymous access or Digest ... Configure Authentication in IIS ...
      (microsoft.public.windows.group_policy)
    • Re: User ASPNET in SQL Server 2000
      ... When you hit a web application that has anonymous access, ... While I love integrated security in SQL Server, it is often a pain in web ... maintenance of accounts with access. ... >>> authentication", and has the same users as in Win 2000 ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: My boss....
      ... Click the Edit button under Authentication and access control, ... properties, Web site tab, Advanced button) ... Exchange virtual directory, clear the anonymous access box, clear Integrated ...
      (microsoft.public.windows.server.dns)