O'Reilly logo

ASP.NET Web API Security Essentials by Rajesh Gunasundaram

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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:

  1. Create New Project from the Start page in Visual Studio.
  2. Select Visual C# Installed Template named Web.
  3. Choose ASP.NET Web Application in the center panel.
  4. Name the project as Chapter06.FormsAuthentication and click OK:
    Implementing Forms authentication in Web API

    Fig 1 – We have named the ASP.NET Web Application "Chapter06.FormsAuthentication"

  5. Select the MVC template in the New ASP.NET Project dialog.
  6. Tick Web API under Add folders ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required