Ask a Question related to ASP.NET Security, Design and Development.
-
Vic #1
isinrole reverts to windowsprincipal?
I'm trying to assign all roles (AD and custom pulled from SQL Table)
to users when they login to the app using Windows Authentication. The
code works fine for local users but fails for AD users if the IIS
server is a member server of the domain. It does seem to work however
if the IIS server is a domain controller (not an option,
unfortunately).
In the global.asax under the WindowsAuthentication_OnAuthenticate
event I grab all the WindowsPrincipal roles using reflection
(...GetMethod("GetRoles"...), grab all the custom roles from the db,
create a GenericPrincipal and assign them. I then assign the
GenericPrincipal to the HttpContext.Current.User.
On my first default.aspx page, I use reflection again to parse out the
roles of my HttpContext.User (...GetField("m_roles"...) and it returns
successfully all the roles I have assigned in the global.asax. The
HttpContext.Current.User.IsInRole("...") however consistently returns
false when checking for any of the SQL roles added, yet works for the
rest.
It seems that in the cases where it fails (windows authentication
against AD using AD account on an IIS member server), the IsInRole
seems to query exclusively against the ORIGINAL WindowsPrincipal,
regardless of what I attempt in my code. I have tried creating my own
custom principal class, played with impersonate options, tried using
Thread instead of HttpContext, etc... to no avail.
Anyone able to shed some light on why this is happening? And
hopefully provide me with a solution?
Victor
Vic Guest
-
I can edit my session but it reverts when I log back in
When I edit my sessions (System > Preferences > Session) to remove firestarter from startup and add Thunderbird, it seems to work fine until I log... -
WindowsPrincipal.IsInRole() is Being Flaky. Help!!
Its just being inconsistent. I'm in 3 different Groups in AD. ..IsInRole("Groupx") returns true ..IsInRole("Groupy") returns true... -
WindowsPrincipal.IsInRole() problem with non-builtin roles
Can't get WindowsPrincipal.IsInRole() to work for me when using Windows Authentication. Here's a snippit of code from my C# codebehind page: ... -
Transparency reverts to 100% in CS
I am using the pen tool to create multiple transparent shapes. In ver 10 I only had to set the transparency in the first shape. Each new shape would... -
CurrentPrincipal, WindowsPrincipal
Hello Friend Please check following Cod Dim x As System.Security.Principal.WindowsPrincipa x = System.Threading.Thread.CurrentPrincipa...



Reply With Quote

