Sunday, December 4, 2016

Web API Token Based Authentication using OWIN, OAuth and Existing Login Table


REST API has become so popular with the rise of Mobile Application usage in the industry. Token Based Authentication is the best way to authenticate the user instead of cookie/session based authentication.

The following are the disadvantages of using server based session authentication
  1.  Using Sessions: On every user successfully authentication, server has to allocate session for the logged in user. So, It increases lot of overhead in the server 
  2.  Scalability: In-Proc sessions are stored in server memory , so it can not be easily scalable. 
  3. CORS: cookies don’t play well in case of multiple different domains. 

The following are the benefits of using token based authentication
  1.  Token based authentication is stateless. We are not storing any information about our user on the server or in a session. 
  2. Easy scalable to different servers 
  3. Easy to use in Mobile Application authentication No issues with CORS
You can download complete documentation from the URL : Download

You can download complete Visual Studio Source Code from the URL : Download

Happy Coding :)

No comments:

Post a Comment