Access Denied on WindowsIdentity.GetCurrent()

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Access Denied on WindowsIdentity.GetCurrent()

    Hi,

    I am developing an ASP.NET Application in C#. I need to find out the
    user under which the process is running on runtime. So I use
    System.Security.Principal.WindowsIdentity.GetCurre nt().Name to get the
    name of the current user. But I get this exception:

    Exception: System.ApplicationException
    Message: Access is denied.

    Source: mscorlib
    at System.Security.Principal.WindowsIdentity._Resolve Identity(IntPtr
    userToken)
    at System.Security.Principal.WindowsIdentity.get_Name ()


    What is the reason for this? Calling
    System.Security.Principal.WindowsIdentity.GetCurre nt().IsAuthenticated
    does not lead to this exception! So what can the reason be?

    Regards
    Marco
    Marco Herrn Guest

  2. Similar Questions and Discussions

    1. Web Service + Anon Access, but getting 401 Access Denied Error
      I have a simple webservice that just returns a string. The security for this is set to windows authentication in IIS (XP Professional) and anonymous...
    2. Access is denied in WindowsIdentity.GetCurrent
      I am suddenly getting this on a couple of Windows XP (.NET 1.1) machines in my environment. The machines haven't change, and my code hasn't...
    3. Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name
      What is the difference between Page.User.Identity.Name and WindowsIdentity.GetCurrent().Name In what scenarios would I use one or the other?
    4. Access denied when creating Access application object
      In an ASP file I am running the following in VBScript in order to extract data from an Access 2002 MDB file which is physically located in the...
    5. access denied on data access pages
      I have created data access pages that worked well when I tried them on two separate computer simutaneously, but when we went into production we got...
  3. #2

    Default Re: Access Denied on WindowsIdentity.GetCurrent()

    On Mon, 07 Mar 2005 11:48:10 +0100, Marco Herrn <nospam_marco.herrn@sourcepark.org> wrote:

    ¤ Hi,
    ¤
    ¤ I am developing an ASP.NET Application in C#. I need to find out the
    ¤ user under which the process is running on runtime. So I use
    ¤ System.Security.Principal.WindowsIdentity.GetCurre nt().Name to get the
    ¤ name of the current user. But I get this exception:
    ¤
    ¤ Exception: System.ApplicationException
    ¤ Message: Access is denied.
    ¤
    ¤ Source: mscorlib
    ¤ at System.Security.Principal.WindowsIdentity._Resolve Identity(IntPtr
    ¤ userToken)
    ¤ at System.Security.Principal.WindowsIdentity.get_Name ()
    ¤
    ¤
    ¤ What is the reason for this? Calling
    ¤ System.Security.Principal.WindowsIdentity.GetCurre nt().IsAuthenticated
    ¤ does not lead to this exception! So what can the reason be?
    ¤
    ¤ Regards
    ¤ Marco

    Which level of authentication is your web app implementing? You don't have Anonymous turned on do
    you?


    Paul ~~~ [email]pclement@ameritech.net[/email]
    Microsoft MVP (Visual Basic)
    Paul Clement Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139