login and user information

Topics: CAB & Smart Client Software Factory
May 2, 2006 at 10:38 AM
originally posted by: ksunair

Hi All,

What is the correct or best way to do this in the SC model. The client logins using the login module. I need to connect to data base to validate the user and once the user is validated, I want to presist the data till the end of application. My question is how can I presist the data (I can use static class - one option) and what is the best way to incorporate the data block in this application since I might have multiple module want to access the same data base.

Any idea or comments would be greatly appriciated.

May 4, 2006 at 10:01 AM
originally posted by: sklett

Look at Thread.CurrentPrincipal
May 4, 2006 at 10:56 AM
originally posted by: ksunair

Thanks for the response, I have lot of information pretaining to User need to be passed between. I came across State attribute in the CAB in which, we would able to pass the object between workitems using IoC.

So in my parent shell I create the object user and then in the child workitem, I use State attribute and my user is available to this work item as well.

Has any one used this approach?
May 4, 2006 at 12:06 PM
originally posted by: sklett

If you need to store additional information about a user, you can derive your own Identity class from IIdentity [[url:http://msdn2.microsoft.com/en-us/library/system.security.principal.iidentity.aspx]]
and store everything in there. This way the logged in user will be passed to additional threads as well(State might do this correctly too, I don't know)

Nice, just found this article, check it out.
[ [url:http://www.codeguru.com/Csharp/.NET/net_security/authentication/article.php/c7415]/ ]