Closed matthewfarrell closed 4 years ago
@matthewfarrell Thanks for the report. I'll do some investigating, but first glance this does look like a bug. I think your suggested fix is probably correct. cc @zfoster
Hi, any progress on this issue? it's affecting my project as well and it's quite important do being able to delete items....
Cheers
Resolved in 3.7.1
Describe the bug When using token based authentication, the auth header sent to CosmosDb is empty
To Reproduce Steps to reproduce the behavior:
Cosmos returns 401 unauthorised. If you inspect the network request to Cosmos, the auth header is null.
Expected behavior The item should delete
Additional context When using tokens, the resourceId that is passed into the method getAuthorizationTokenUsingResourceTokens in src/auth.ts is passing the full path to the item id (not the collection):
dbs/<database>/colls/<collection>/<item id>
. I'm not sure if this is as intended?To work around the issue, I added the following code to look for a token in a parent resource, though I wonder if the correct fix would be to pass in the resourceId for the collection instead of the item?
src/auth.ts line 71