【发布时间】:2013-11-21 12:28:36
【问题描述】:
我正在使用 Google Cloud Storage 来存储我的 Google App Engine 应用程序的图像,并且我正在尝试像这样访问这些图像:
<img src="https://storage.googleapis.com/BUCKET_NAME/IMAGE_NAME">
但是,这会显示“拒绝访问”或向我显示 Google 登录提示。 然后我尝试使用Signed URLs 授予客户端访问权限。
我生成了要签名的 URL,如下所示:
String HTTP_Verb = "GET";
String Expiration = "1361993085";
String Canonicalized_Resource = "/bucket_name/sub_directory";
String stringToSign = HTTP_Verb + "\n" + Expiration + "\n" + Canonicalized_Resource;
然后用p12文件生成Base64,用Java编译,但是出现这个错误:
The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.
我在这里做错了什么?有什么方法可以在没有身份验证的情况下从 GCS 访问图像?
【问题讨论】: