Hello I am using Security Application block in a winform Application. In my application I am using .NET MEMBERSHIP class and using the default Membership database with the help of (aspnet_regsql.exe). Things worked good upto the varification of a username
and password in the loginForm. Now after successfully verifying the username in my login form I want to get this authenticated user Token in the my other Application forms. Now I am lost here that how can I achieve this. I mean when I am executing the below
code in my other application forms it is working, which I dont like or may be this is the way to do it...
ISecurityCacheProvider secureCache = SecurityCacheFactory.GetSecurityCacheProvider("Caching Store Provider");
userToken = CacheFactory.GetCacheManager();
IToken token = PropertyLoader.AuthenticatedUserToken;
if (token != null)
IIdentity savedIdentity = secureCache.GetIdentity(token);
this.Text = savedIdentity.Name;
Now here I am using a static PropertyLoader.AuthenticatedUserToken and first saving the authenticated token in a static field in the login form and then retrieving it here in another form of my application. Can anybody please help
me out...that how can I eliminate this satic field and can directly get the authenticated token from the block. Do I need to cache Application Block ... may be I am lost....
Thanks and regards