0

I have an existing project using MySQL Database and entity framework (database-first). In the database, i have tables for both user and roles. How do I implement authorization based on the roles? I am using no authentication when I first created the project. I heard that I could create a new project using individual user accounts but it will create 5 tables such as appusers, appclaims, etc.. but based on the client's requirement, i am only allowed to have user table and role table. Cheers!

Wolfeatspotatoes
  • 115
  • 1
  • 2
  • 10
  • Are these answers what you are looking for? https://stackoverflow.com/questions/20529401/how-to-customize-authentication-to-my-own-set-of-tables-in-asp-net-web-api-2 https://stackoverflow.com/questions/36176074/implementing-role-based-authorization-in-mvc-and-web-api-with-custom-table – Rosco Jun 13 '20 at 03:25
  • Thanks for this! I think I can start with authentication, however it still does not address the authorization problem. Do i need to install certain Nuget or anything else to enable authorization? – Wolfeatspotatoes Jun 13 '20 at 04:12
  • Make a new WebAPI project and enable Individual authentication. Then compare/merge the files in the new project with your project. packages.config has a few identity/security related packages and there is code in startup classes and App_start to enable authentication – Rosco Jun 14 '20 at 23:24

0 Answers0