Re: Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 12/13/04
- Next message: Pradeep Gupta via DotNetMonster.com: "Re: Win32 Application CryptoAPI"
- Previous message: abu: "Unhandled Exception: System.TypeInitializationException:"
- In reply to: Shary: "Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name"
- Next in thread: Nicole Calinoiu: "Re: Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 13 Dec 2004 11:14:08 -0600
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@gmail.com> wrote in message
news:99ef4d4.0412111239.322eb802@posting.google.com...
> What is the difference between
> Page.User.Identity.Name
> and
> WindowsIdentity.GetCurrent().Name
>
> In what scenarios would I use one or the other?
- Next message: Pradeep Gupta via DotNetMonster.com: "Re: Win32 Application CryptoAPI"
- Previous message: abu: "Unhandled Exception: System.TypeInitializationException:"
- In reply to: Shary: "Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name"
- Next in thread: Nicole Calinoiu: "Re: Page.User.Identity.Name vs. WindowsIdentity.GetCurrent().Name"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|