Hiding API Key on Xively Image

江枫思渺然 提交于 2019-12-11 09:07:09

问题


I'm interested in using Xively's image embed code in a website I'm working on, but I need to either:

  1. Make the Xively feed public in order to access the image

  2. Include the API key in the get request

Now I do not want to expose our private information or open up the datastreams to being modified without my permission using my API key, what options do we have? In other words, how can I conceal the API key in the image URL that your can easily find by viewing the source? I'm not particularly keen on saving the image locally, renaming it, and then serving it from our server with a different name.


回答1:


Xively API keys have very fine-grain permissions. You probably want to generate a key that has:

  1. read-only access to just that specific feed
  2. referrer set to the domain of your website

You will find an "Add Key" button on your develop workbench, see screenshot below.

This should protect your data, but still keep your device's feed private.



来源:https://stackoverflow.com/questions/16732749/hiding-api-key-on-xively-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!