api - How is "token auth" any different than "cookie auth"? -


on surface, seems "token auth" same thing traditional "cookie auth".

token auth:

  1. user submits username/password api
  2. api responds access token
  3. client stores access token identifying user in future requests

cookie auth:

  1. user submits username/password api
  2. api responds cookie
  3. client stores cookie identifying user in future requests

it seems token auth same cookie auth, except http clients know how deal managing cookies automatically, whereas have manually manage api tokens.

what missing? benefits of using token auth? worth effort?

whether effort worth it, depends on protecting , consuming api.

token based authentication easier when clients non-browser based. if you're targetting mobile applications, token based authentication worth considering.

but in browser scenario has advantages. browser not automatically send authorization header, security token not vulnerable csrf attacks.

if web application lives on domain api, cookies not sent because of same-origin policy. security tokens not affected this.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -