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

Basic authentication using an authentication filter

With the release of ASP.NET Web API 2.0, it is best practice to use an authentication filter for basic authentication rather than using an HTTP module. Follow the given steps to implement basic authentication using an authentication filter:

  1. Create New Project from the Start page in Visual Studio.
  2. Select Visual C# Installed Template named Web.
  3. Select ASP.NET Web Application in the center pane.
  4. Name the project Chapter05.BasicAuthentication and click OK:
    Basic authentication using an authentication filter

    Fig 3 – We have named the ASP.NET Web Application as "Chapter05.BasicAuthentication"

  5. Select the MVC template in the New ASP.NET Project dialog.

    Fig 4 – ...

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