JSONP 是否仅适用于完全公共的 API?

发布于 2024-09-14 22:59:18 字数 375 浏览 3 评论 0原文

我使用 WCF 数据服务开发了一个 API,它公开了我的网站用户的数据。

那里托管的数据属于每个用户并且不公开,因此 API 通过每个客户端唯一的 API 密钥以及基于 http 标头或 GET 参数的身份验证来保护。

现在我想知道是否应该在我的 API 上启用 JSONP。看起来这会让混搭变得更容易,但另一方面,我看到了如下的博客文章,这似乎表明 JSONP 本身是不安全的:

http://robubu.com/?p=24

我是否理解有误,或者 JSONP 确实仅适用于公共 API?

谢谢,

阿德里安

I've developed an API with WCF Data Services which exposes my website user's data.

The data hosted there belongs to each user and is not public, so the API is secured with API keys which are unique to each client and http header or GET parameter based authentication.

Now I am wondering if I should enable JSONP on my API. It seems that it would make mash-ups much easier, but on the other side I've seen blog postings like the following, which seem to suggest that JSONP is per se insecure:

http://robubu.com/?p=24

Am I understanding something wrong, or is JSONP indeed only meant for public API's?

Thanks,

Adrian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

々眼睛长脚气 2024-09-21 22:59:18

JSON(P)只是简单的数据格式,我认为谈论JSON的安全性是错误的。应在传输和解释 JSON 中的信息时考虑安全性。

信息可以在打包为 JSON 格式之前进行加密,也可以对整个 JSON 消息进行加密。安全性基于加密的强度,并且 JSON 可以在不安全的环境中使用。

JSON(P) is simply data format and I think that it's wrong to talk about security of JSON. Security should be considered in context of transportation and interpretation of information that is packed in JSON.

Informations can be encrypted before they are packed in JSON format or whole JSON messages can be encrypted. Security is then based on the strength of the encryption and JSON can be used in insecure enviroment.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文