Thread.CurrentPrincipal still returns GenericPrincipal

  • Thread starter Thread starter manny.klystron
  • Start date Start date
M

manny.klystron

I'm calling AppDomain.SetPrincipalPolicy() with WindowsPrincipal, but
Thread.CurrentPrincipal still returns a GenericPrincipal.

I don't see Thread.CurrentPrincipal being set before this (which can
cause it).

Are there any other circumstances under which this can happen? This is
..NET 2.0, Kerberos authentication, on an AppDomain spawned from the
main (and a second thread within that domain).

Thanks!
 
SetPrincipalPolicy can have all sorts of strange behavior - e.g. you are
only allowed to call it once etc..

In general i would set Thread.CurrentPrincipal manually...
 
Furthermore, when I create a one-off WindowsPrincipal using the
MSDN-site recommended method "new
WindowsPrincipal(WindowsIdentity.GetCurrent())", the Identity is
correct and authenticated.

However, IsInRole("machine\\Users") returns false, and the principal's
m_rolesLoaded member is still false after the call.
 
Back
Top