How do I secure REST API calls?

前端 未结 6 1036
南旧
南旧 2020-11-29 15:51

I\'m developing the restful web app that using some popular web framework on the backend, say (rails, sinatra, flask, express.js). Ideally, I want to develop client side wit

6条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-29 16:28

    1. Set a SESSION var on the server when the client first loads your index.html (or backbone.js etc.)

    2. Check this var on the server-side on every API call.

    P.S. this is not a "security" solution!!! This is just to ease the load on your server so people don't abuse it or "hotlink" your API from other websites and apps.

提交回复
热议问题