Skip to main content

Securing ASP.NET Web API using Custom Token Based Authentication

In modern era of development we use web API for various purpose for sharing data, or for binding grid, drop-down list, and other controls, but if we do not secure this API then other people who are going access your web application or service can misuse it in some or other way and also we are into era of client-side framework (JavaScript, Angular js, react js, express js, common js..Etc) if you are using one of these client-side frameworks then you are using web service or web API it is true for getting or posting data to server and been on client side is less secure you need to add extra efforts to secure it.

In this article we are going to learn that extra part, the process of securing Web API begins with registering process in this part we are first going to register a user, after user registration next user who is registered is going to login into application, after login into application User need to register a company which is going to use this service, after company registration the next step we are going to get ClientID and ClientSecert keys.

After getting keys next we are going use these keys for authentication the first request to access API must come with valid ClientID and ClientSecert next it will validate keys and then it is going to provide Token in response, this token you need to use in every request to authenticate that you are valid user and this Token expires in 30 min but if you want to provide custom time according to your need you can do it.

Also, this token is secured using AES 256 encryption algorithm.

Read Entire Article on below link   :- https://www.codeproject.com/Articles/1183150/Securing-ASP-NET-Web-API-using-Custom-Token-Based

 

 

Comments

Popular posts from this blog

Spire.Office for .NET

Introduction Free Spire.Doc for .NET is a Community Edition of the Spire.Doc for .NET, which is a totally free word component for commercial and personal use. As a free C#/VB.NET component, it also offers a lot of powerful functions. Developers can use it to generate, read, write, save, print and convert documents on any .NET applications. The featured function, conversion allows converting Word documents (Word 97-2003, Word 2007, Word 2010, word 2013) to commonly used file format, such as XML, RTF, TXT, PDF, XPS, EPUB, HTML and Image etc. Visit Site for Details :-  Click Here to Visit Official Site     Click here to Download Tools :- Download Here In this article we are going to learn how to generate DOC file Use Powerful tool Spire.Office for .NET Tool Required We are using Visual Studio 2012. Free Spire.Office Component [Free for commercial and personal use] Support .Net from [ 2.0 to 4.5 ] Getting Started Let’s start with cre...

Capturing Image From Web Cam in ASP.Net MVC

This article shows how to capture an image using a webcam in MVC4 and in this application we will use a jQuery webcam.js plug-in for capturing images. I have seen that most online applications currently require webcam image capturing functionality in some way or another. Most social networking sites use this kind of functionality in their application for capturing user profile pictures. To see Complete Article Visit: -  http://www.c-sharpcorner.com/UploadFile/4d9083/capturing-image-from-web-cam-in-Asp-Net-mvc139/ Agenda Create basic MVC application. Download and Adding webcam.js related reference files to project. Adding Controller ( PhotoController ). Adding Index view. Adding Action Method Capture( ). Adding Script for capturing Image. Adding Action Method and Script for binding image. Adding [HttpPost] Index Action Method. Displaying the index View in New Window. Changephoto.cshtml Code Snippet. PhotoController Code Snippet. Index.cshtml Code ...

Securing ASP.NET CORE Web API using Custom API Key based Authentication

In this article, we are going to learn how to create a secure Web API in ASP.NET Core MVC. Link to Complete Article with source code:-   https://www.codeproject.com/Articles/1228892/Securing-ASP-NET-CORE-Web-API-using-Custom-API-Key In the fast-growing era of Web technology, everything is changing too fast. With ASP.NET there was a time when we used to use web service (the .asmx ones), which was SOAP-based, which we can just use for consuming data from other applications, which did have that much of security in it. Most developers would take Username and Password Parameter as input and then they would allow to access web service. As time passes, Microsoft came up with WCF which was secured but too complex to use. Further, Microsoft came up with something new called as Web API which we can use by creating ASP.NET MVC application or directly ASP.NET Web API application which was lighter and easy to use. But moving further, Microsoft introduces ASP.NET Core wh...