Swift troubleshooting FormPost: Invalid Signature

asked 2016-12-14 11:50:46 -0500

updated 2016-12-15 01:48:32 -0500

Hello everyone,

I have a swift setup with tempauth and formpost.

I have correctly setup a "x-account-meta-temp-url-key" and am using it to create a formpost signature but I keep receiving "Invalid Signature" when uploading.

My form:

<form method="POST" enctype="multipart/form-data" action="http://192.168.99.100:8080/v1/AUTH_admin/default/testing">
        <input type="hidden" name="redirect" value="http://192.168.99.100/">
        <input type="hidden" name="max_file_size" value="1073741824">
        <input type="hidden" name="max_file_count" value="1">
        <input type="hidden" name="expires" value="1481737496161">
        <input type="hidden" name="signature" value="1b4f64fa08d29807736c382838414ad116533e97">
        <input type="file" name="file">

            <input type="submit">

    </form>

The private key for this is default1481271067936bizzpeek

I cannot figure out if it either is the signature generation that is faulty (I've created my own as I couldn't find an already made example in nodeJS) or if it is something else...

Can anyone point me in the right direction to troubleshoot this?

EDIT:

I've managed to troubleshoot a bit more, I have used the swift-temp-url that comes with object storage to create the signature for my form, I then edited my form using the given values. This would allow me to be sure that the signature was indeed hashed correctly. I kept getting the same error.

I've then tried to set x-account-meta-temp-url-keyinstead of x-container-meta-temp-url-key and it started working. So I'm guessing that it was saying invalid signature because it couldn't find a temp-url-key to use to confirm the signature.

The new question is, is it possible to use a container's temp-url-key to sign formpost requests or just the account's?

edit retag flag offensive close merge delete

Comments

The temp url key is actually on the container, not the account.

salketer gravatar imagesalketer ( 2016-12-14 12:13:18 -0500 )edit