Sending an unauthorized request

To view the outcome of sending an unauthorized request to a Web API controller, which is decorated with Authorize attribute, let's create a Web API by following the given steps:

  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 WebAPIWithAuthorize and click OK:
    Sending an unauthorized request

    Fig 9 – We have named the ASP.NET Web Application as "WebAPIWithAuthorize"

  5. Select the Web API template in the New ASP.NET Project dialog. This will select Web API and MVC by default under Add folders and core references.
  6. Click OK to create the ...

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.