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:
- Create New Project from the Start page in Visual Studio.
- Select Visual C# Installed Template named Web.
- Select ASP.NET Web Application in the center pane.
- Name the project
Chapter05.BasicAuthentication
and click OK: - Select the MVC template in the New ASP.NET Project dialog.
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.