[英]Can the Amazon Product API be accessed from Javascript (Chrome Extension)
I've been playing about with Chrome extensions and one of the things I'd like to do is request product information from the Amazon Product Advertising API . 我一直在使用Chrome扩展程序,我想做的其中一件事是从亚马逊产品广告API请求产品信息。 The code to do this is pretty straight forward but so far the only way I can find to access the API is to create a signed request which involves using your AWS public and secret keys.
执行此操作的代码非常简单,但到目前为止,我可以找到访问API的唯一方法是创建一个签名请求,其中涉及使用您的AWS公钥和密钥。 Unfortunately this would mean embedding my AWS keys in the Chrome Extension which would allow anyone to access them so this is obviously a no go.
不幸的是,这意味着将我的AWS密钥嵌入Chrome扩展程序,这将允许任何人访问它们,所以这显然是不行的。
Does anyone know if the API can be accessed without including my secret key? 有没有人知道是否可以在不包含我的密钥的情况下访问API? Has anyone done this using Javascript (and in particular from a Chrome extension that allows me to get ignore the same origin policy).
有没有人使用Javascript(特别是Chrome扩展程序,允许我忽略相同的原始政策)完成此操作。
Looking into this it really seems like this can't be done directly from Javascript without potentially exposing your secret key. 考虑到这一点,看起来似乎无法直接从Javascript完成此操作而不会泄露您的密钥。 The only options I've discovered are:
我发现的唯一选择是:
Sadly, I think both of these options are a bit more than I'd planned on using so I've given up on my extension for now. 可悲的是,我认为这些选项都比我计划使用的要多一些,所以我现在放弃了我的扩展。 It's a bit disappointing that Amazon don't allow easier access to their data but I guess they feel they have to protect it from competitors.
有点令人失望的是,亚马逊不允许更容易地访问他们的数据,但我猜他们认为他们必须保护它免受竞争对手的侵害。
I guess you need a server to do your request! 我想你需要一台服务器来做你的请求! Lets the extension send the resquest to your server and there the request to amazon is done (php).
让扩展程序将resquest发送到您的服务器,并在那里完成对amazon的请求(php)。 The result of that you can use in your extension!
您可以在扩展中使用的结果!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.