Identity.IsAuthenticated always false ??

From: Claude Vernier (ClaudeVernier_at_discussions.microsoft.com)
Date: 06/28/04

  • Next message: Joe Kaplan \(MVP - ADSI\): "Re: Authenticate Against localhost and AD"
    Date: Mon, 28 Jun 2004 09:12:01 -0700
    
    

    Hello, I already posted about Unit tests some posts ago
    but I'm still having a problem and I can't figure out any clues...

    I got this DLL that contains all the logic for a web application.
    Two web-applications will use it (for a start), one with Windows Authentication
    and one with anonymous or custom forms.

    Also, my DLL is tested by a WinForm application: NUnit-GUI.

    This DLL must call several web services.
    Most are using Windows Authentication, some don't.

    I need a way to determine if user is logged and if not, I map it to a guest user.

    I was using this code:

    if( System.Threading.Thread.CurrentPrincipal.Identity.IsAuthenticated )
            //... use System.Net.CredentialCache.DefaultCredentials
    else
            //... create new Network credentials...

    Testing in NUnitGUI, I found that System.Threading.Thread.CurrentPrincipal.Identity.IsAuthenticated
    thinks that I'm not authenticated, while I am...

    Is there any rational explanation to this ??

    Thanks you very much!
    Claude Vernier


  • Next message: Joe Kaplan \(MVP - ADSI\): "Re: Authenticate Against localhost and AD"

    Relevant Pages

    • Re: Web Service/Impersonation Issue - RESOLVED
      ... with the Windows DLL named "security.dll". ... > to various web services for data retrieval. ... The MS SQL Server calls do not cause any issues, ... I've compared IIS configuration as ...
      (microsoft.public.dotnet.security)
    • Re: How to use .RESX or .RESOURCE to retrieve list of strings
      ... reading about the different flavors of web services that can be ... This project does not create a DLL ... Can I still use resources from a .RESX file in this scenario? ... A possibly easier method is to add a Resource RESX file to your DLL ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: Newbie Q about base classes and where to put them
      ... I've set up a DLL and placed it elsewhere on my file-system (ie NOT ... under my web services directory) and added a Reference to it. ... I'm going to be creating about 200 web services that will share some ... But I want to use the same base class in my other web ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: unable to load DLL (<filename>.dll)
      ... However, since you placed it in the bin directory, I would assume that ... i'm currently working on web services using C#. i've> used external DLL in my project. ... > i've try to put the dll file in the bin folder of the web> service project, the System32 folder and added reference> to the dll in the web service project. ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Webservice Error Unable to find System.Web
      ... against the dll you think is the correct one. ... If that pans out, you'll need ... to make sure that the url that the web services is called from contains that ... The project does have a reference to the System.Web assembly. ...
      (microsoft.public.dotnet.framework)