Hi, All,
I use CSLA authentication for a window application. When people try to access the winApp, the user's activeDiectory name System.Security.Principal.WindowsIdentity.GetCurrent().Name will be used as parameter to pass to login() to check the Authentication. (we don't have the login form) In the dataPortal part of business logic layer, I directly use “Csla.ApplicationContext.User.Identity.Name” at stored procedure for the create_user. It looks like
cm.Parameters.AddWithValue("@user_name", Csla.ApplicationContext.User.Identity.Name);
it works for my WinApp.I only need to checklogin once and Csla.ApplicationContext.User.Identity.Name will keep the userName
But I have the problem on my web application to use the same business objects. The Csla.ApplicationContext.User.Identity.Name won’t give me the user name (ASPNET or domain\actDirName), it will give me the empty string. I can get the userName at the Web UI, so, the only way I could solve this is to pass the userName to my dataPortal layer for my WebApp. Is this the right way to do it? is there a better solution?
Thanks
Brian
Are you using the global.asax like the PTWeb project does in the Project Tracker solution?
Thanks for Brent and Andres' help. It works now.
Copyright (c) Marimer LLC