Put files into Google Cloud Storage (GCS) via signed URL


kctang:

I'm trying to use a "signed URL" to access/upload files to Google Cloud Storage (GCS).

Follow the instructions at https://developers.google.com/storage/docs/accesscontrol#Signing-Strings

what did I do:

  • "Web Application" is registered in Google Cloud Console.
  • Generate a new private key using "Generate New Key" in the "Certificates" section of the registered web application screen.
  • Created the string to be signed and signed it using the sample code provided in the "How to Sign" section of that page (with some minor tweaks to the hardcoded values ​​of the Java main program). Update: Created gist for GcsSigner.java .
  • Make sure the signed string is URL encoded.
  • Specified HTTP headers: x-goog-api-version, x-goog-project-id, Content-Type.
  • Specified URL parameters: GoogleAccessId, Signature, Expiration.
  • Emulate PUT requests using Postman (a Chrome extension).

However, I still get this (status: 403 Forbidden):

<?xml version='1.0' encoding='UTF-8'?>
<Error>
    <Code>SignatureDoesNotMatch</Code>
    <Message>The request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.</Message>
    <StringToSign>PUT

text/plain
1384084959392
x-goog-api-version:2
x-goog-project-id:99999
/mybucket/myfile.txt</StringToSign>
</Error>

Even if I retry signing the string based on the value in "StringToSign", I still get the same error.

Read various related posts here, but couldn't find any solution, most of which I referenced x-goog-api-version:1when using version 2 .

What am I missing? Any help would be greatly appreciated.

kctang:

Finally managed to get the file into Google Cloud Storage using the signed URL. This is simulated by creating a simple Java program:

  • ServerSign and encode the string into the signature.
  • UploaderAs an unauthenticated user, submit PUT requests using only the provided signature Server. The browser is emulated using Apache's HTTP client library.

You can view the demo application here .

I really don't understand why it doesn't work when I submit via Chrome's Postman extension.

Related


Put files into Google Cloud Storage (GCS) via signed URL

tea soup I'm trying to use a "signed URL" to access/upload files to Google Cloud Storage (GCS). Follow the instructions at https://developers.google.com/storage/docs/accesscontrol#Signing-Strings what did I do: "Web Application" is registered in Google Cloud C

Put files into Google Cloud Storage (GCS) via signed URL

kctang: I'm trying to use a "signed URL" to access/upload files to Google Cloud Storage (GCS). Follow the instructions at https://developers.google.com/storage/docs/accesscontrol#Signing-Strings what did I do: "Web Application" is registered in Google Cloud Co

Put files into Google Cloud Storage (GCS) via signed URL

kctang: I'm trying to use a "signed URL" to access/upload files to Google Cloud Storage (GCS). Follow the instructions at https://developers.google.com/storage/docs/accesscontrol#Signing-Strings what did I do: "Web Application" is registered in Google Cloud Co

Upload to Google Cloud Storage via signed URL - object not public

username I followed this tutorial to allow direct upload of files from the GWT frontend to Google Cloud Storage using signed URLs. I extended the Java example by specifying a content-type that works fine. Then, I found out that files uploaded this way are not

Upload to Google Cloud Storage via signed URL - object not public

username I followed this tutorial to allow direct upload of files from the GWT frontend to Google Cloud Storage using signed URLs. I extended the Java example by specifying a content-type that works fine. Then, I found out that files uploaded this way are not

Upload to Google Cloud Storage via signed URL - object not public

username I followed this tutorial to allow direct upload of files from the GWT frontend to Google Cloud Storage using signed URLs. I extended the Java example by specifying a content-type that works fine. Then I see that files uploaded this way are not publicl

Upload to Google Cloud Storage via signed URL - object not public

username I followed this tutorial to allow direct upload of files from the GWT frontend to Google Cloud Storage using signed URLs. I extended the Java example by specifying a content-type that works fine. Then I see that files uploaded this way are not publicl

Python: read all files as gcs_uri in google cloud storage

low I'm new to google cloud platform and I have this problem: In my google bucket, I have 5 folders, each folder contains 100 audio files (.wav), and I want to access each folder , then convert speech to -text. I managed to get the second part done using googl

Signed URL for GCS PUT request on GAE with Python

hamx0r I'm trying to create a signed URL for uploading files directly to Google Cloud Storage (GCS). I got it working using POST using this Github example , which makes use of policies. Following best practices, I'm refactoring to use PUT and getting the error

Signed URL for GCS PUT request on GAE with Python

hamx0r I'm trying to create a signed URL for uploading files directly to Google Cloud Storage (GCS). I got it working using POST using this Github example , which makes use of policies. Following best practices, I'm refactoring to use PUT and getting the error

Signed URL for GCS PUT request on GAE with Python

hamx0r I'm trying to create a signed URL for uploading files directly to Google Cloud Storage (GCS). I got it working using POST using this Github example , which makes use of policies. Following best practices, I'm refactoring to use PUT and getting the error

Signed URL for GCS PUT request on GAE with Python

hamx0r I'm trying to create a signed URL for uploading files directly to Google Cloud Storage (GCS). I got it working using POST using this Github example , which makes use of policies. Following best practices, I'm refactoring to use PUT and getting the error

Signed URL for GCS PUT request on GAE with Python

hamx0r I'm trying to create a signed URL for uploading files directly to Google Cloud Storage (GCS). I got it working using POST using this Github example , which makes use of policies. Following best practices, I'm refactoring to use PUT and getting the error

Signed URL for GCS PUT request on GAE with Python

hamx0r I'm trying to create a signed URL for uploading files directly to Google Cloud Storage (GCS). I got it working using POST using this Github example , which makes use of policies. Following best practices, I'm refactoring to use PUT and getting the error

Provide callback URL in Google Cloud Storage signed URL

username When uploading to GCS (Google Cloud Storage) using BlobStore's createUploadURL function , I can provide a callback along with header data that will be sent to the callback URL. There doesn't seem to be a way to use GCS's signed URLs I know there are "

Provide callback URL in Google Cloud Storage signed URL

username When uploading to GCS (Google Cloud Storage) using BlobStore's createUploadURL function , I can provide a callback along with header data that will be sent to the callback URL. There doesn't seem to be a way to use GCS's signed URLs I know there are "

Provide callback URL in Google Cloud Storage signed URL

username When uploading to GCS (Google Cloud Storage) using BlobStore's createUploadURL function , I can provide a callback along with header data that will be sent to the callback URL. There doesn't seem to be a way to use GCS's signed URLs I know there are "

Provide callback URL in Google Cloud Storage signed URL

username When uploading to GCS (Google Cloud Storage) using BlobStore's createUploadURL function , I can provide a callback along with header data that will be sent to the callback URL. There doesn't seem to be a way to use GCS's signed URLs I know there are "

Provide callback URL in Google Cloud Storage signed URL

username When uploading to GCS (Google Cloud Storage) using BlobStore's createUploadURL function , I can provide a callback along with header data that will be sent to the callback URL. There doesn't seem to be a way to use GCS's signed URLs I know there are "

Provide callback URL in Google Cloud Storage signed URL

username When uploading to GCS (Google Cloud Storage) using BlobStore's createUploadURL function , I can provide a callback along with header data that will be sent to the callback URL. There doesn't seem to be a way to use GCS's signed URLs I know there are "

Google storage with signed URL

Bouwan How to upload files of content type mutlipart/formdata ---boundaryStringusing Google Storage's signed URL ? The problem I'm facing is that when we upload the file using the browser, the browser places the mutlipart/formdata ---boundaryStringwhere bounda

Google storage with signed URL

Bouwan How to upload files of content type mutlipart/formdata ---boundaryStringusing Google Storage's signed URL ? The problem I'm facing is that when we upload the file using the browser, the browser places the mutlipart/formdata ---boundaryStringwhere bounda