Custom membership or not

后端 未结 5 648
既然无缘
既然无缘 2021-02-04 14:21

I am creating website (football, soccer) in ASP.NET MVC3 and I want have users (with additional information then user in default membership, these are ordinary visitors) and pla

5条回答
  •  遥遥无期
    2021-02-04 14:59

    I Advice you to:

    • Use Membership provider to just deal with user registration and authentication. And let it take care of user security stuffs (rest password, validate user ....)

    • Then use Roles to separate your users to their roles ("Players, normalUsers,..").

    • And NEVER use Profile provider cause it cost so many traffic you don't want and instead of you could make your custom table in DataBase to store your additional information.

    • Then you may use EF or any ORM to get this information whenever you want.

    • Don't forget to use authorization attributes [Authorize(Roles="Players")]in your Controllers and Actions deppending on the Roles.

提交回复
热议问题