Hi @James G Foster ,
I have checked the REST call with .NET code and it works fine with the above scope and with "x-ms-version" as "2018-12-31".
Also, please make sure that you are providing RBAC permissions as mentioned over here
I have assigned "Cosmos DB Built-in Data Contributor" role for my testing and it worked as expected.
Result-
Also, here is how my token payload looks like -
I having internal discussion with the products team as it looks like the version mentioned in the documentation is incorrect. Please let me know if you have any questions.
Thanks
Saurabh
Hi @James G Foster ,
I have received the below information -
It looks like provided token does not have a valid signature. Being able to decode the token does not mean that the signature of the token in valid. Can you please ensure that the token has a valid signature.
Also, how are you generating the token ? what all scopes you are passing ?
Thanks
Saurabh
Hi @Saurabh Sharma ,
How would I ensure that the token has a valid signature? I'm able to refresh the token with AAD; is that enough?
I'm generating the token by calling https://login.microsoftonline.com/$_tenantId/oauth2/v2.0/token with appropriate headers and body, including a scope of 'opened offline_access'.
What should I use for 'x-ms-version'? Should I use '2021-03-15'? Should I use '2018-12-31'? Or something else.
James
Hi @amesgfoster-9024,
Please change the scope to 'Use https://{0}/.default for scope, where {0} is account endpoint.' e.g. https://<account-name>.documents.azure.com/.default and try checking with 2018-12-31 version.
Thanks
Saurabh
Sign in to comment