api - How is "token auth" any different than "cookie auth"? -
on surface, seems "token auth" same thing traditional "cookie auth".
token auth:
- user submits username/password api
- api responds access token
- client stores access token identifying user in future requests
cookie auth:
- user submits username/password api
- api responds cookie
- 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
Post a Comment