Print Page | Close Window

Multiple Authentication

Printed From: IdeaBlade
Category: Cocktail
Forum Name: Community Forum
Forum Discription: A professional application framework using Caliburn.Micro and DevForce
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=4002
Printed Date: 29-Apr-2025 at 12:27pm


Topic: Multiple Authentication
Posted By: pjcunningham
Subject: Multiple Authentication
Date Posted: 22-Feb-2013 at 3:41am

Can Cocktail be configured to use multiple authentications?

I have a requirement to allow an application to login in to multiple databases (different models) simultaneously – this is at the proof of concept stage.

My initial thought was to have multiple implementations of AuthenticationService, all exporting IAuthenticationService. My LoginViewModel imports many IAuthenticationService (exposed as a combo box so the user can choose which authentication service to login to).

There are a couple of issues;

In Composition.Clients.cs OnEntityManagerCreated gives the error “Probed for service with contract IAuthenticationService and found multiple matching exports” – so it seems I can only have one IAuthenticationService.

Secondly, if I could have multiple AuthenticationServices how to configure the individual EntityManagerProviders to use the correct AuthenticationService?

 

Regards, Paul




Replies:
Posted By: mgood
Date Posted: 22-Feb-2013 at 10:34am
Paul,
The short answer is no. .NET just like pretty much any other technology does not have a notion of multiple current principals. The Thread.CurrentPrincipal property only takes a single principal (http://msdn.microsoft.com/en-us/library/system.threading.thread.currentprincipal.aspx).

If you have this requirement you need to look into federated identity and single sign-on (SSO) technologies. There is no restriction on the DevForce/Cocktail side to integrate SSO and federated identity systems. 


Posted By: pjcunningham
Date Posted: 22-Feb-2013 at 11:09am
Thanks Marcel for your reply and the link you've provided.

I was thinking about an application similar to SQL Management Studio (and other variations), where I can login in to multiple databases.

Regards, Paul.


Posted By: mgood
Date Posted: 22-Feb-2013 at 11:47am
Technically, something like that is possible, but it requires extending parts of Cocktail and probably a custom AuthenticationService. Our team of consultants can help you explore and build a custom solution that meets your requirements. 



Print Page | Close Window