Access Denied on WindowsIdentity.GetCurrent()

Discussion in 'ASP .Net Security' started by Marco Herrn, Mar 7, 2005.

  1. Marco Herrn

    Marco Herrn Guest

    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.GetCurrent().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._ResolveIdentity(IntPtr
    userToken)
    at System.Security.Principal.WindowsIdentity.get_Name()


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

    Regards
    Marco
     
    Marco Herrn, Mar 7, 2005
    #1
    1. Advertising

  2. Marco Herrn

    Paul Clement Guest

    On Mon, 07 Mar 2005 11:48:10 +0100, Marco Herrn <> 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.GetCurrent().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._ResolveIdentity(IntPtr
    ¤ userToken)
    ¤ at System.Security.Principal.WindowsIdentity.get_Name()
    ¤
    ¤
    ¤ What is the reason for this? Calling
    ¤ System.Security.Principal.WindowsIdentity.GetCurrent().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 ~~~
    Microsoft MVP (Visual Basic)
     
    Paul Clement, Mar 7, 2005
    #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. =?Utf-8?B?Um9nZXI=?=

    WindowsIdentity.GetCurrent()

    =?Utf-8?B?Um9nZXI=?=, Apr 13, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    814
    =?Utf-8?B?Um9nZXI=?=
    Apr 13, 2006
  2. Replies:
    0
    Views:
    552
  3. Shary
    Replies:
    3
    Views:
    459
    Nicole Calinoiu
    Dec 14, 2004
  4. Robert Phillips

    Access is denied in WindowsIdentity.GetCurrent

    Robert Phillips, Jan 13, 2005, in forum: ASP .Net Security
    Replies:
    0
    Views:
    164
    Robert Phillips
    Jan 13, 2005
  5. Jeremy Chapman

    System.Security.Principal.WindowsIdentity.GetCurre nt()

    Jeremy Chapman, Sep 9, 2005, in forum: ASP .Net Security
    Replies:
    3
    Views:
    202
    Nicole Calinoiu
    Sep 10, 2005
Loading...

Share This Page