2

I'm trying to use a new dropbox datastore API with my chrome extension. If used as specified in tutoria, auth will fail with error 400:

Invalid redirect_uri: "chrome-extension://anzbpdekhbhcbekwmfazaophjcaabshl/chrome_oauth_receiver.html". It must exactly match one of the redirect URIs you've pre-configured for your app (including the path)

If i add this URL to my app profile at dropbox website, all works fine. But "anzbpdekhbhcbekwmfazaophjcaabshl" is a computer-unique value, it will be different for each extension installation for each user. Is it possible to somehow fix this or dropbox datastore API is intended to be used on static websites where redirect url is known?

Update 1

Extension ID is random for manual/non-public extension installation.

Update 2

I have found a way to make extension ID persistent: just pack it, generate a public key fro private .pem key and set this key's base-64 encoded value as 'key' in manifest.

4

2 回答 2

4

将我的评论移至答案(有关详细信息,请参阅问题的更新):

我认为扩展 ID(chrome-extension:// 之后的部分)不是特定于用户或计算机的,并且在安装 Chrome 扩展的任何地方都保持不变。

于 2013-10-11T16:56:54.187 回答
1

我成功地使用了 Firefox 扩展中的 Datastore API。诀窍是将保管箱脚本附加到实际网页,而不是本地页面。我的服务器上托管了一个空白页面,扩展程序打开该页面并附加了必要的脚本。从那里它将用户重定向到 Dropbox 身份验证页面。

用户通过身份验证后,我使用 page-worker API 在“无头”选项卡中打开同一页面。(不知道 Chrome 扩展是否有同等功能)

重定向 URL 必须是 https,因此您需要获得 SSL 证书才能使其正常工作。

于 2013-10-11T07:08:45.180 回答