401: Unauthorized. Problem calling web service from forms authenti

Discussion in 'ASP .Net Web Services' started by mike, Jun 4, 2009.

  1. mike

    mike Guest

    I have an ASP.NET 3.5 web site which calls a ASP.NET web service
    I am required (don't ask) to only allow authenticated users make web service
    calls.
    As in;

    <authorization>
    <deny users="?" />
    <!--<allow roles="submitter"/>-->
    <deny users="*" />
    </authorization>

    The application does not use Windows authentication but Forms authentication.
    I'm getting a 401: Unauthorized error when trying to make web service calls.

    the web service Web.config has these settings as well as the above
    <authentication mode="Windows"/>
    <identity impersonate="true" />

    I am setting the Credentials on my web service the following way

    CredentialCache cache = new CredentialCache();
    cache.Add(new Uri(service.Url), "Basic", new
    NetworkCredential(LoggedInUser.Login, LoggedInUser.Password));
    service.Credentials = cache;
    service.PreAuthenticate = true;

    The IIS Directory Securty setting are set to allow Anonymous access and
    "Integrated Windows" authentication for the web services.

    what am I doing wrong here?

    thanks
    mike
    mike, Jun 4, 2009
    #1
    1. Advertising

  2. mike

    Mr. Arnold Guest

    Re: Unauthorized. Problem calling web service from forms authenti

    "mike" <> wrote in message
    news:...
    >
    > The application does not use Windows authentication but Forms
    > authentication.
    > I'm getting a 401: Unauthorized error when trying to make web service
    > calls.
    >
    >


    It means whatever the account is that is being presented to the ASP.NET Web
    Service site and the site's virtual directory is in valid.

    You need to go to the Web server where the Web service is hosted, enable the
    NT based O/S's Audit for Login Success/Fail, go to the System Event Log,
    and find out what is the user\account being presented at login failure.


    __________ Information from ESET NOD32 Antivirus, version of virus signature database 4135 (20090606) __________

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com
    Mr. Arnold, Jun 6, 2009
    #2
    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. Vijayakrishna Pondala

    The remote server returned an error: (401) Unauthorized

    Vijayakrishna Pondala, Aug 22, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    27,955
    William C.
    Aug 22, 2005
  2. =?Utf-8?B?S3lsZSBCYWxleQ==?=

    401 Unauthorized error in local web service

    =?Utf-8?B?S3lsZSBCYWxleQ==?=, Aug 3, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,349
    =?Utf-8?B?S3lsZSBCYWxleQ==?=
    Aug 3, 2005
  3. Replies:
    2
    Views:
    639
  4. Francois Guerin

    Unauthorized Error Calling Web Service

    Francois Guerin, Aug 20, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    178
    Francois Guerin
    Aug 20, 2004
  5. raveesh khosa
    Replies:
    1
    Views:
    141
    Simon Hart
    Apr 22, 2006
Loading...

Share This Page