Autentication and Custom ModuleEnumerator

Topics: CAB & Smart Client Software Factory
Jul 6, 2007 at 10:05 AM
Hi Folks,

I'm working now on application based on CAB. The one of my tasks is develop functionality that will allow plugins (modules) upload according to user permissions. The idea is, after user successfuly login, system will get his config (SolutionProfile) file with special structure and then using custom ModuleEnumerator class read the modules to be started.

My question is where it would be best to put autentication logic and show login form call, so that the autentication were made before ModuleEnumerator starts enumerate modules.

Looking forwards to your suggestions,
Alexey
Jul 6, 2007 at 2:54 PM
You need to replace the default implementation of the IAuthenticationService with your own version in the Shell when it starts up:

 protected override void AddServices()
{
            base.AddServices();
 
            RootWorkItem.Services.Remove<IAuthenticationService>();
            RootWorkItem.Services.AddNew<MyAuthenticationService, IAuthenticationService>();
}

In your custom authentication service you can do whatever you want: authenticate the user, grab a profile, load specified roles, whatever.
Jul 6, 2007 at 5:07 PM
Hi! You can see an example of implementing your own AuthenticationService in the Bank Branch Reference Implementation.
Hope it helps!

Luciano G. Panaro
http://staff.southworks.net/lpanaro
Jul 7, 2007 at 9:45 AM

ChrisHolmes wrote:
You need to replace the default implementation of the IAuthenticationService with your own version in the Shell when it starts up:
...
In your custom authentication service you can do whatever you want: authenticate the user, grab a profile, load specified roles, whatever.


Hi Chris,

It's so simple! I wondering, why I didn't found it before by myself?! :-)

Thanks,
Alexey
Jul 7, 2007 at 9:48 AM

lgpanaro wrote:
Hi! You can see an example of implementing your own AuthenticationService in the Bank Branch Reference Implementation.
Hope it helps!


Hi Luciano,

Thanks for the link! It will be very interesting for me to review migration process from WinForms to WPF!

Regards,
Alexey