Implicit OAuth2 endpoint vs. cookies

Posted by Jamie on Programmers See other posts from Programmers or by Jamie
Published on 2014-04-24T09:44:59Z Indexed on 2014/08/22 16:36 UTC
Read the original article Hit count: 262

Filed under:
|
|
|

I currently have an app which basically runs two halves of an API - a restful API for the web app, and a synchronisation API for the native clients (all over SSL).

The web app is completely javascript based and is quite similar to the native clients anyway - except it currently does not work offline.

What I'm hoping to do is merge the fragmented APIs into a single restful API. The web app currently authenticates by issuing a cookie to the client whereas the native clients work using a custom HMAC access token implementation. Obviously a public/private key scenario for a javascript app is a little pointless.

I think the best solution would be to create an OAuth2 endpoint on the API (like Instagram, for example http://instagram.com/developer/authentication/) which is used by both the native apps and the web app.

My question is, in terms of security how does an implicit OAuth2 flow compare (storing the access token in local storage) to "secure" cookies? Presumably although SSL solves man in the middle attacks, the user could theoretically grab the access token from local storage and copy it to another machine?

© Programmers or respective owner

Related posts about security

Related posts about api