Search code examples
javascriptajaxoauthflickr

Is it possible to implement Oauth 1.0 through just javascript without any server side script?


I am trying to develop a Jquery plugin for Flickr photo exploring. But i am stuck on authenticating user. Flickr support Oauth 1.0.

My question is do you think there is any way to implement Oauth 1.0 with just Javascript? "With just Javascript" means I cannot use any server side script. I have to make all the request through Ajax. You know Ajax has cross origin restriction and from my experiment the links for Oauth don't allow CORS/jsonp.


Solution

  • No it is not possible. This is one of the reasons OAuth 2.0 was born.

    https://blog.apigee.com/detail/oauth_differences

    For instance, OAuth 2.0 also clearly lays out how to use OAuth entirely inside a browser using JavaScript that has no way to securely store a token, and it explains at a high level how to use it on a mobile phone or even on a device that has no web browser at all.