0

I'm trying to design MVC4.5 website on Azure with latest EF but stuck in setting up membership and role base authentication.

I'm somewhat lost in MembershipProvider, SimpleMembershipProvider and ExtendedMembershipProvider.

I found that unlike SqlMembershipProvider the SimplememberShipProvider is not designed to store multiple applications (through ApplicationName and ApplicationID) in a single database and map users accordingly so that business can run multiple applications with only one database.

I hear all praises of SimpleMembershipProvider, my question is how should the database/providers be designed so that I'm able to store user's in association with respective applications in a single database. User registration info must be completely independent from same user name in other application. I also need new features of Open Authentication.

Broadly, my queries are:

  1. Is it possible to use SimpleMmebershipProvider to differentiate between multiple applications in a single database.

  2. I'm thinking to modify existing schema structure made by SimpleMembershipProvider to include ApplicationId column , but then how would even a custom provider that is inherited from Extended membership provider add ApplicationId against any user.

  3. Is there any other provider available or any article that would guide in implementing custom membership provider with custom database design along with features of open authentication.

    Or am I going with completely wrong approach?

Answering to the queries of BernardG

  1. Do you want a "head" url/site, then redirect users to the proper application, or

    No, sites should not appear related nor will be redirect to other.

  2. Do you want a user to enter into any application and then be redirected to another one he is registered in.

    Again no, each application should have it's own registration process. Further two applications can have same username but these accounts would not be related.

  3. Can a user register into any application?

    Yes.

  4. If not, how do you limit that?

    Not limiting.

  5. What do you mean by this?"User registration info must be completely independent from same user name in other application."

    Refering to answer to point 2, if there are 4 applications with one database and a user registers for one application, he must need to register again to have access to other application. Hence for any user the sites must not appear related.

  6. Do you want to duplicate users info into each applications?

    As per my understanding of the question a combination of username and email address (considering this combination makes any user account unique) can again be stored against another application even with different profile information.

Actually I'm used to the classic membership approach used in ASP.net 2.0 and I'm missing the application Id column for separation.

4

1 回答 1

1

如果可以的话,我相信您的问题更多地与设计和明确建立您想要的功能有关,而不是特定的会员提供商,因为您知道您可以使用 SimpleMembership 做任何您想做的事情。

我的问题,我相信这些是你在继续之前必须问自己的问题,是:

  1. 您是否想要一个“头部”网址/站点,然后将用户重定向到正确的应用程序,或者

  2. 您是否希望用户进入任何应用程序,然后被重定向到他注册的另一个应用程序。

  3. 用户可以注册到任何应用程序吗?

  4. 如果没有,你如何限制它?

  5. 这是什么意思?“用户注册信息必须完全独立于其他应用程序中的相同用户名。”

  6. 您想将用户信息复制到每个应用程序中吗?

在我看来,这完全是为了满足您的实际需求而进行的数据库设计和分析。一旦正确完成,关于成员表的部分将很容易解决。

于 2013-10-06T14:22:04.617 回答