TheTeaMan
TheTeaMan

Reputation: 2513

Multiple membership providers, one user

I am learning ASP.NET MVC 3 and trying to create a web application where users can upload some data and manage it.

Here is my problem: I need to associate users to data in my database therefore I need users to have unique ids. However, users need to be able to log in from multiple membership providers (sql and ldap). So I can't assume their ProviderUserKey is unique nor can I assume what type it is.

What I need is some way to merge the users provided by the different membership providers into one user class that has unique user ids usable in my database. Can anyone give me some pointers on how to do this?

I am new to ASP.NET MVC 3 framework, so I don't know if something like this already exist or not.

E: I want the business logic to be oblivious to how the user logged in. It shouldn't matter to it.

Upvotes: 1

Views: 364

Answers (1)

dove
dove

Reputation: 20674

Their ldap email address could provide a good unique identifier, I have used this in a similar situation.

Upvotes: 1

Related Questions