I am using azure-cli to generate SAS token
az storage blob generate-sas --account-key mykey --account-name myaccount --container-name my --expiry 2023-01-01T00:00:00Z --name 0.0.1/uk/787867898767/structure/calendar/a12calendar.json --permissions r
Which returns a SAS token which looks like:
se=2023-01-01T00%3A00%3A00Z&sp=r&sv=2020-02-10&sr=b&sig=u2VWd2i8cdYhkjA%2BZRBCYZbHwmZDCrjirs%2BYstwxmjI%3D
I have a rest assured test which does a GET to
given().get("https://myaccount.blob.core.windows.net/mycontainer/0.0.1/uk/787867898767/structure/calendar/a12calendar.json?se=2023-01-01T00%3A00%3A00Z&sp=r&sv=2020-02-10&sr=b&sig=u2VWd2i8cdYhkjA%2BZRBCYZbHwmZDCrjirs%2BYstwxmjI%3DD").then().statusCode(200)
which fails with a HTTP 403.
<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:5ab15b27-701e-00b3-298c-b0ffa0000000
Time:2021-09-23T15:08:56.1619254Z</Message><AuthenticationErrorDetail>Signature fields not well formed.</AuthenticationErrorDetail></Error>
BUT the same url works fine on Postman and Chrome. Looks like some kind of encoding issue, but can't find what. Any help would be hugely appreciated .