Implementing Forms authentication in Web API
To send the credentials to the server, we need an HTML form to submit. Let's use the HTML form or HTML view in the ASP.NET MVC application.
Steps to implement Forms authentication in an ASP.NET MVC application are as follows:
- Create New Project from the Start page in Visual Studio.
- Select Visual C# Installed Template named Web.
- Choose ASP.NET Web Application in the center panel.
- Name the project as
Chapter06.FormsAuthentication
and click OK: - Select the MVC template in the New ASP.NET Project dialog.
- Tick Web API under Add folders ...
Get ASP.NET Web API Security Essentials now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.