I feel what I am attempting should be reasonably simple but I keep getting stumped on every approach. I would like to use Windows Authentication for my web app, but then take the Windows LogonID and map it to a Custom LogonID in a database to obtain permissions. I created a Custom Principal and a Customer Identity (modeled after PTTracker) and I can assign them both to Csla.ApplicationContext.User. However, they don't stay there. Am I supposed to be able to get them to stay there? Each time Application_AuthenticateRequest is called, the Csla.ApplicationContext.User has been replaced with WindowsIdentity and WindowsPrincipal.
My goal is to capture the user's windows logon info, then build a GenericIdentity and GenericPrincipal that I can use on server or client side anywhere within the app. I feel I am missing something very basic. Any guidance would be greatly appreciated. I've spent days on trying to do this.
Thanks for the reply. I checked and I did not have any entry in my web.config. However, adding the entry did not help (regardless of the value). That led me to checking other things though and I discovered that I was missing a command like this:
HttpContext
.Current.Session["CslaPrincipal"] = Csla.ApplicationContext.User;And I think that was the source of my problem. I also was putting code in Application_AuthenticateRequest but I needed to move it to Session_Start (not sure why yet).
Anyway, I am moving forward and I will post my results when I get all the kinks worked out. My goal is to have an app that can use Windows or Forms Auth. If it is Windows Auth, then the app will generate a token for the user and actually use Forms Auth.
Copyright (c) Marimer LLC