Azure / azure-storage-cpplite

Lite version of C++ Client Library for Microsoft Azure Storage
MIT License
25 stars 44 forks source link

Azurite authentication fails #66

Open joe-maley opened 4 years ago

joe-maley commented 4 years ago

I am unable to authenticate with the latest Azurite release (https://hub.docker.com/_/microsoft-azure-storage-azurite) using this cpplite client.

Using the same code that works on the production Azure, but using the storage_account::development_storage_account(), I am able to connect with a locally running Azurite instance but the authentication fails.

Is this supported? Is there a workaround?

debug.log

Jinming-Hu commented 4 years ago

@XiaoningLiu Hi Xiaoning, this user is having some problems running cpplite against Azurite, here is the credential, can you help have a look?

XiaoningLiu commented 4 years ago

Generally sounds good. Here is the stringToSign Azurite uses. @JinmingHu-MSFT can you help check string to sign cpplite uses?

  31 2020-02-18T17:12:07.088Z 128d68e6-0c68-4694-9692-9ca17bfa9c92 info: BlobSharedKeyAuthenticator:validate() [STRING TO SIGN]:"HEAD\n\n\n\n\n\n\n\n\n\n\n\nx-ms-date:Tue, 18 Feb 2020 17:12:06 GMT\     nx-ms-version:2018-11-09\n/devstoreaccount1/devstoreaccount1/tiledb-140698467149760-1582045926061\nrestype:container"
Jinming-Hu commented 4 years ago

This is a bug in cpplite sdk. Becasue in the official documentation, it says "If you are authorizing against the storage emulator, the account name will appear twice in the CanonicalizedResource string." But cpplite currently only appends it once.

Jinming-Hu commented 4 years ago

This issue should've been fixed in the latest 0.3.0 release.