Search code examples
asp.net-mvcasp.net-web-apiasp.net-authorizationasp.net-authentication

ASP.NET MVC/Web Api common Authorization and Authentication


What is the most common scenario to deal with Authorization and Authentication using ASP.NET MVC and WEB API?

I found some blogs talking about Web Tokens and how OAuth, Owin and Identity are a good choice for WEB API, but I didn't found a good resource showing how to use the same method with both projects. Maybe I am looking wrong.

Am I out of right way? Is it possible?

Thank you all!


Solution

  • The most common is to use forms authentication that's built in with MVC.

    This is where the user registers for an account and their user information is stored in your database. You can then restrict which controllers/actions can be accessed based on the role of the user (which you can assign)