Windows authentication on a Web service returning Access Denied (401).

Discussion in 'ASP .Net' started by Daniel Bass, Feb 5, 2004.

  1. Daniel Bass

    Daniel Bass Guest

    Hey,

    [ Background ]
    I've been asked to look into network security where an IIS virtual directory
    is configure to not have anonymous access, but rather to go with the windows
    authentication (what the user signs in as at client). This is in the context
    of a ASP.Net web service running on an intranet.

    [ What I have done ]
    - I've ticked and unticked all the right boxes in IIS.
    - I've also added the
    "myserviceproxy.Credentials =
    System.Net.CredentialCache.DefaultCredentials;"
    to the client side [ Web / Windows ] Application so that they are passed
    through to the server for the request message.
    - I've also ensured that my user account on the client side, is registered
    as a user on the server on which the web service resides.

    [ The problem ]
    But when I try to process any messages, I get back an HTTP 401: Access
    Denied message.
    What am I doing wrong, or not doing at all?
    I'm very new to all this, so if I'm missing something obvious, please
    forgive me.

    Thanks for your time.
    Daniel.
    Daniel Bass, Feb 5, 2004
    #1
    1. Advertising

  2. Daniel Bass

    Paul Guest

    Daniel,

    What happens when you just go to the .asmx page using IE?

    -Paul

    "Daniel Bass" <I'm really @ sick of spam> wrote in message
    news:%23XjFjp$...
    > Hey,
    >
    > [ Background ]
    > I've been asked to look into network security where an IIS virtual

    directory
    > is configure to not have anonymous access, but rather to go with the

    windows
    > authentication (what the user signs in as at client). This is in the

    context
    > of a ASP.Net web service running on an intranet.
    >
    > [ What I have done ]
    > - I've ticked and unticked all the right boxes in IIS.
    > - I've also added the
    > "myserviceproxy.Credentials =
    > System.Net.CredentialCache.DefaultCredentials;"
    > to the client side [ Web / Windows ] Application so that they are

    passed
    > through to the server for the request message.
    > - I've also ensured that my user account on the client side, is registered
    > as a user on the server on which the web service resides.
    >
    > [ The problem ]
    > But when I try to process any messages, I get back an HTTP 401: Access
    > Denied message.
    > What am I doing wrong, or not doing at all?
    > I'm very new to all this, so if I'm missing something obvious, please
    > forgive me.
    >
    > Thanks for your time.
    > Daniel.
    >
    >
    Paul, Feb 5, 2004
    #2
    1. Advertising

  3. Daniel Bass

    Daniel Bass Guest

    Paul

    That works as you'd expect, giving you that page with the avialable methods
    on the web service.

    Dan

    "Paul" <> wrote in message
    news:...
    Daniel,

    What happens when you just go to the .asmx page using IE?

    -Paul

    "Daniel Bass" <I'm really @ sick of spam> wrote in message
    news:%23XjFjp$...
    > Hey,
    >
    > [ Background ]
    > I've been asked to look into network security where an IIS virtual

    directory
    > is configure to not have anonymous access, but rather to go with the

    windows
    > authentication (what the user signs in as at client). This is in the

    context
    > of a ASP.Net web service running on an intranet.
    >
    > [ What I have done ]
    > - I've ticked and unticked all the right boxes in IIS.
    > - I've also added the
    > "myserviceproxy.Credentials =
    > System.Net.CredentialCache.DefaultCredentials;"
    > to the client side [ Web / Windows ] Application so that they are

    passed
    > through to the server for the request message.
    > - I've also ensured that my user account on the client side, is registered
    > as a user on the server on which the web service resides.
    >
    > [ The problem ]
    > But when I try to process any messages, I get back an HTTP 401: Access
    > Denied message.
    > What am I doing wrong, or not doing at all?
    > I'm very new to all this, so if I'm missing something obvious, please
    > forgive me.
    >
    > Thanks for your time.
    > Daniel.
    >
    >
    Daniel Bass, Feb 6, 2004
    #3
  4. Daniel Bass

    Ed Guest

    Daniel or Paul,

    Was there any resolution to this problem? I am having the same
    problem as Daniel describes. I have even gone as far as making a
    "dummy" method on the web service that returns the
    System.Net.Security.WindowsPrincipal.Identity and it shows my user
    name.... When I try to connect to a SQL Server DB from that same Web
    Service, using SSPI, it tries to connect as anonymous.

    Is there some setting that I am missing?

    Thanks, any information would be helpful.

    Ed Castaneda


    "Daniel Bass" <I'm really @ sick of spam> wrote in message news:<Om$>...
    > Paul
    >
    > That works as you'd expect, giving you that page with the avialable methods
    > on the web service.
    >
    > Dan
    >
    > "Paul" <> wrote in message
    > news:...
    > Daniel,
    >
    > What happens when you just go to the .asmx page using IE?
    >
    > -Paul
    >
    > "Daniel Bass" <I'm really @ sick of spam> wrote in message
    > news:%23XjFjp$...
    > > Hey,
    > >
    > > [ Background ]
    > > I've been asked to look into network security where an IIS virtual

    > directory
    > > is configure to not have anonymous access, but rather to go with the

    > windows
    > > authentication (what the user signs in as at client). This is in the

    > context
    > > of a ASP.Net web service running on an intranet.
    > >
    > > [ What I have done ]
    > > - I've ticked and unticked all the right boxes in IIS.
    > > - I've also added the
    > > "myserviceproxy.Credentials =
    > > System.Net.CredentialCache.DefaultCredentials;"
    > > to the client side [ Web / Windows ] Application so that they are

    > passed
    > > through to the server for the request message.
    > > - I've also ensured that my user account on the client side, is registered
    > > as a user on the server on which the web service resides.
    > >
    > > [ The problem ]
    > > But when I try to process any messages, I get back an HTTP 401: Access
    > > Denied message.
    > > What am I doing wrong, or not doing at all?
    > > I'm very new to all this, so if I'm missing something obvious, please
    > > forgive me.
    > >
    > > Thanks for your time.
    > > Daniel.
    > >
    > >
    Ed, Feb 11, 2004
    #4
  5. Have you setup directory permissions (ACL's) on the base directory of the
    web app allowing at least read access to the domain users / groups that are
    to access the webservice ?
    This is how it is set up for us and it works very well.

    You might be authenticated all right but you don't have any access to the
    directory so IIS dosen't allow you in.

    Chris.

    "Ed" <> wrote in message
    news:...
    > Daniel or Paul,
    >
    > Was there any resolution to this problem? I am having the same
    > problem as Daniel describes. I have even gone as far as making a
    > "dummy" method on the web service that returns the
    > System.Net.Security.WindowsPrincipal.Identity and it shows my user
    > name.... When I try to connect to a SQL Server DB from that same Web
    > Service, using SSPI, it tries to connect as anonymous.
    >
    > Is there some setting that I am missing?
    >
    > Thanks, any information would be helpful.
    >
    > Ed Castaneda
    >
    >
    > "Daniel Bass" <I'm really @ sick of spam> wrote in message

    news:<Om$>...
    > > Paul
    > >
    > > That works as you'd expect, giving you that page with the avialable

    methods
    > > on the web service.
    > >
    > > Dan
    > >
    > > "Paul" <> wrote in message
    > > news:...
    > > Daniel,
    > >
    > > What happens when you just go to the .asmx page using IE?
    > >
    > > -Paul
    > >
    > > "Daniel Bass" <I'm really @ sick of spam> wrote in message
    > > news:%23XjFjp$...
    > > > Hey,
    > > >
    > > > [ Background ]
    > > > I've been asked to look into network security where an IIS virtual

    > > directory
    > > > is configure to not have anonymous access, but rather to go with the

    > > windows
    > > > authentication (what the user signs in as at client). This is in the

    > > context
    > > > of a ASP.Net web service running on an intranet.
    > > >
    > > > [ What I have done ]
    > > > - I've ticked and unticked all the right boxes in IIS.
    > > > - I've also added the
    > > > "myserviceproxy.Credentials =
    > > > System.Net.CredentialCache.DefaultCredentials;"
    > > > to the client side [ Web / Windows ] Application so that they are

    > > passed
    > > > through to the server for the request message.
    > > > - I've also ensured that my user account on the client side, is

    registered
    > > > as a user on the server on which the web service resides.
    > > >
    > > > [ The problem ]
    > > > But when I try to process any messages, I get back an HTTP 401: Access
    > > > Denied message.
    > > > What am I doing wrong, or not doing at all?
    > > > I'm very new to all this, so if I'm missing something obvious, please
    > > > forgive me.
    > > >
    > > > Thanks for your time.
    > > > Daniel.
    > > >
    > > >
    Christian Boult, Feb 18, 2004
    #5
  6. Daniel Bass

    shijobaby

    Joined:
    Dec 15, 2009
    Messages:
    7
    If your web service anonymous authentication is


    turned off you must enable that

    Otherwise you have to pass username and password
    shijobaby, Feb 6, 2010
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    1
    Views:
    690
    Jan Tielens
    Jan 3, 2004
  2. Daniel Bass
    Replies:
    3
    Views:
    140
  3. Alex Washtell via .NET 247

    Web Service + Anon Access, but getting 401 Access Denied Error

    Alex Washtell via .NET 247, Apr 5, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    196
    Mauro Ottaviani [MSFT]
    Apr 5, 2005
  4. Web Service HTTP 401: Access Denied Problems

    , Sep 23, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    171
  5. David Palau

    Web Service HTTP 401: Access Denied Problems

    David Palau, Sep 23, 2005, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    170
    David Palau
    Oct 11, 2005
Loading...

Share This Page