Professional Web Applications Themes

Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name - ASP.NET Security

What is the difference between Page.User.Identity.Name and WindowsIdentity.GetCurrent().Name In what scenarios would I use one or the other?...

Sponsored Links
  1. #1

    Default 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?
    Sponsored Links
    Shary Guest

  2. #2

    Default Re: Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name

    Hi Shary

    Page.User.Identity.Name can also return the name of a user logged in with
    FormsAuthentication or Passport.

    --
    Daniel Fisher(lennybacon)
    MCP ASP.NET C#
    Blog: [url]http://www.lennybacon.com/[/url]


    "Shary" <junglesnake> wrote in message
    news:99ef4d4.0412111239.322eb802posting.google.co m...
    > What is the difference between
    > Page.User.Identity.Name
    > and
    > WindowsIdentity.GetCurrent().Name
    >
    > In what scenarios would I use one or the other?

    Daniel Fisher\(lennybacon\) Guest

  3. #3

    Default Re: Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name

    Page.User.Identity.Name will be the name of the user who authenticated with
    the site, assuming they used one of the supported authentication mechanisms
    (Windows, Forms, Passport). Note that this use can be a Windows user
    (WindowsPrincipal/WindowsIdentity), but it could also be any other
    IPrincipal as well.

    WindowsIdentity.GetCurrent().Name is the WindowsIdentity that the current
    thread is executing under. It controls what security context is used by
    unmanaged code, such as accessing files, SQL or AD. It will either be the
    process account or an impersonated account.

    The two will be the same thing if you are using impersonation with ASP.NET
    and are using Windows authentication. Otherwise, they can be different.

    HTH,

    Joe K.

    "Shary" <junglesnake> wrote in message
    news:99ef4d4.0412111239.322eb802posting.google.co m...
    > What is the difference between
    > Page.User.Identity.Name
    > and
    > WindowsIdentity.GetCurrent().Name
    >
    > In what scenarios would I use one or the other?

    Joe Kaplan \(MVP - ADSI\) Guest

  4. #4

    Default Re: Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name

    You might want to take a look at
    [url]http://msdn.microsoft.com/library/en-us/dnnetsec/html/SecNetAP05.asp[/url]. It
    contains descriptions of the principal and identity objects used by ASP.NET,
    as well as their expected values under various combinations of IIS and
    ASP.NET authentication schemes.

    HTH,
    Nicole


    "Shary" <junglesnake> wrote in message
    news:99ef4d4.0412111239.322eb802posting.google.co m...
    > What is the difference between
    > Page.User.Identity.Name
    > and
    > WindowsIdentity.GetCurrent().Name
    >
    > In what scenarios would I use one or the other?

    Nicole Calinoiu Guest

Similar Threads

  1. Access Denied on WindowsIdentity.GetCurrent()
    By Marco Herrn in forum ASP.NET Security
    Replies: 1
    Last Post: March 7th, 03:36 PM
  2. Access is denied in WindowsIdentity.GetCurrent
    By Robert Phillips in forum ASP.NET Security
    Replies: 0
    Last Post: January 13th, 07:23 PM
  3. *** User.Identity.Name
    By Ian in forum ASP.NET Security
    Replies: 1
    Last Post: April 13th, 01:21 PM
  4. User.Identity.Name
    By Nedu N in forum ASP.NET Building Controls
    Replies: 3
    Last Post: December 9th, 02:51 AM
  5. Old ASP Windows User Identity
    By Alex Maghen in forum ASP
    Replies: 2
    Last Post: October 22nd, 05:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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