-
Notifications
You must be signed in to change notification settings - Fork 4
Description
When I was trying to use the createTags API, the tags parameter seems cannot be parsed by your service if formatted as an JSON object, which is stated in your API documentation. For example (the value of the resourceids field is removed):
{
"resourceids": "",
"resourcetype": "PublicIpAddress",
"tags": {"key": "cloud-description", "value": "Test-1"}
}This will return the following error message:
HTTP status code: 401, Error message: unable to verify user credentials and/or request signature
The credentials are correct, because I used the same credentials to request the listTags API and it worked just fine.
I've also tried several different formats, like "tags": {"cloud-description": "Test-1"} and "tags": [{"key": "cloud-description", "value": "Test-1"}], but none of them worked.
The idea of generating a signature from the content of the query string is really a bad practice. No modern authentication systems use this as it would make it impossible to tell whether it's a problem of the query string or wrong credentials. It also made it unnecessarily obscure to construct the query string. Modern APIs like the CloudFlare API uses the industry standard HTTP Bearer Token as the authentication method, which makes everyone's life easier.