Open georgeboot opened 2 years ago
Turns out, the correct string to sign should be like this (reverse enigineered from Python SDK for Azure Blob):
$stringToSign = implode("\n", [
'',
'',
'',
"/blob/{$accountName}/{$container}",
$storedAccessPolicy,
'',
'',
'2020-10-02',
'c',
'',
'',
'',
'',
'',
'',
]);
Which service(blob, file, queue, table) does this issue concern?
blob
Which version of the SDK was used?
1.5.3
What's the PHP/OS version?
8.1.0
What problem was encountered?
I can't create a SAS using just a Stored Access Policy. The helpers always want a list of permissions and the expiry date.
However, when using Microsoft Azure Storage Explorer, I can generate a SAS that has only the
sv
,si
,sr
andsig
.When trying to create a SAS using
BlobSharedAccessSignatureHelper::generateBlobServiceSharedAccessSignatureToken
and by supplying the permissions and dates from the SAP, I do get a SAS url but it doesn't work.Steps to reproduce the issue?
The helper outputs (SAS doesn't work):
However, the Microsoft Azure Storage Explorer, generates the following through the UI (working SAS):
I tried generating the SAS myself, but I can't figure out what to sign. The documentation is very vague about it.
I tried the following:
None of these work. They all produce incorrect signatures.