angularjs - What is the main reason to use headers for authentication tokens? -


just getting speed authentication in angular . read lot usage of headers pass in token here: $http auth headers in angularjs question passing in token every request backend main reasons use headers? cleaner solution or performance?

using headers isn't angular thing, many apis use these example server can determine if client should allowed access examining headers , not request body. allows better separation of concerns between authentication , authorization functions, , payload processing on server.

upstream servers (of there may many layers) can add , remove headers , route , authorize request more efficiently if data in request body.

headers keep authentication data out of url request parameters looks cleaner stops authentication data appearing in browser history etc.

one downside if making requests through network proxy there's chance proxy may strip headers if they're non-standard names.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -