-
Book Overview & Buying
-
Table Of Contents
ASP.NET Web API Security Essentials
By :
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:
Create New Project from the Start page in Visual Studio.
Select Visual C# Installed Template named Web.
Choose ASP.NET Web Application in the center panel.
Name the project as Chapter06.FormsAuthentication and click OK:

Fig 1 – We have named the ASP.NET Web Application "Chapter06.FormsAuthentication"
Select the MVC template in the New ASP.NET Project dialog.
Tick Web API under Add folders and core references and press OK, leaving the Authentication to Individual User Accounts:

Fig 2 – Select MVC template and check Web API in add folders and core references
Forms authentication configuration can be included in the web.config file, as follows:
<system.web>
<authentication mode="Forms">
<forms loginUrl="~/Account...
Change the font size
Change margin width
Change background colour