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
- 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
- Scalability: In-Proc sessions are stored in server memory , so it can not be easily scalable.
- CORS: cookies don’t play well in case of multiple different domains.
The following are the benefits of using token based authentication
- Token based authentication is stateless. We are not storing any information about our user on the server or in a session.
- Easy scalable to different servers
- Easy to use in Mobile Application authentication No issues with CORS
You can download complete Visual Studio Source Code from the URL : Download
Happy Coding :)
No comments:
Post a Comment