-
Book Overview & Buying
-
Table Of Contents
ASP.NET Web API Security Essentials
By :
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:
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 WebAPIWithAuthorize and click OK:

Fig 9 – We have named the ASP.NET Web Application as "WebAPIWithAuthorize"
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.
Click OK to create the application, leaving Authentication as Individual User Accounts by default:

Fig 10 – We have selected Web API
The created Web API project contains an MVC controller named HomeController and two Web API controllers namely, AccountController and ValuesController. AccountController deals with user account operations, such as registration, log in, log out...
Change the font size
Change margin width
Change background colour