-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not able to upload file using Put operation #7
Comments
@sapphireroofing I faced the exact issue you're facing, I just don't remember the exact solution I used. I don't have time to dig that up right now (sorry!), but one possible solution would be to update the x-ms-version you're using. |
@sapphireroofing @BenRamins did either of you find a solution for this? |
can you post your headers here? |
I believe I found the issue, but working on something for a fix |
@BenRamins On a GET request with the console I get this which leads to this Signature String which is successful. ON a PUT request this is the results Signature Parts Which builds this, obviously causing the issue with the signature Signature String I believe it's related to #6 |
@steveb85 try this: x-ms-version:2017-11-09 |
@BenRamins The duplication isn't from my headers, it's because the script isn't catching the type Content Type or Content Length at all, and then is adding them to the Canonical Items that come in the script at line 31 in postman. Content Type was defined in my headers as "text/plain charset =UTF-8" is that incorrect? Thanks for the help! Cheers |
@steveb85 for a text file, here's the exact headers I use that work just fine: headers: { Alternatively you can take a look here: https://www.postman.com/speeding-astronaut-338068/workspace/azure-rest-api/overview I wrote it a while ago but still works - hope it helps! |
Thanks @BenRamins huge help. I got it to work with a little pushing around, it's a bit rudimentary and hacked but from getting it to work once, I think I can work through what I need in a script to make it work! much appreciated though. |
@BenRamins just looking through your speeding-astronaut postman post, very informative, it seems you choose to create a bearer token rather than using the HMACSHA256 method of encription that this postman collection does, is there any advantages / disadvantages to the two methods? |
@steveb85 the bearer token is Azure's automatic authorization method when accessing their REST APIs (at least all the ones I've worked with). I had no need for something extra at that time. |
for anyone else on this struggle, check carefully that your Params tab has nothing in it, even when not ticked, it becomes part of the canonicalResourceParts, thus throws the signature off. |
Hi Kamranayub,
I have downloaded your postman collection and tried to perform some operations on blob. The GET operation works fine, but when I try to upload a file using PUT operation I am receiving the following error :
AuthenticationFailed
Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. RequestId:e0cdd282-301e-0030-656f-63747e000000 Time:2021-06-17T11:57:01.6867488Z The MAC signature found in the HTTP request '9GvSpqmVGuFV+HPPR4daDlzJV8MN6SELFrvINwgtbS0=' is not the same as any computed signature. Server used following string to sign: 'PUT56
text/plain
x-ms-blob-type:BlockBlob
x-ms-date:Thu, 17 Jun 2021 11:57:01 GMT
x-ms-version:2017-04-17
Could you guide me on how to resolve the issue?
The text was updated successfully, but these errors were encountered: