question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unauthorized, The input authorization token can't serve the request: url encoding issue

See original GitHub issue

Similar to #82, we’re seeing the error message in the title. The full error object is this:

{
    "code":"Unauthorized",
    "message":"The input authorization token can\'t serve the request. Please check that the expected payload is built as per the protocol, and check the key being used. Server used the following payload to sign: \'put\\ndocs\\ndbs/testdb/colls/pouchdb-test-collection/docs/ÿattach-storeÿmd5-CRq749X7/wgSD6EQeGTuFg==\\nwed, 21 jun 2017 21:28:58 gmt\\n\\n\'\\r\\nActivityId: 9f9d22ea-9c51-4b4e-bd51-de7ca5a68c1e"
}

My doc id is ÿattach-storeÿmd5-CRq749X7%2fwgSD6EQeGTuFg== and as you can see it has a %2f in it, and the underlying auth system seems to do a URL-Decode on the input key when signing the request.

Is this expected behaviour? What is the recommended way to encode and decode keys in a way that it is safe with DocumentDB/CosmosDB?

Grateful for any help 😃

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
roghernandezcommented, May 21, 2019

2019 still getting this error as well

0reactions
ribsthakkarcommented, Jun 10, 2019

@ribsthakkar Can you open an issue on the Java repo? https://github.com/Azure/azure-cosmosdb-java This one is for our older JavaScript SDK Just did: https://github.com/Azure/azure-cosmosdb-java/issues/180

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unauthorized, The input authorization token can't serve the ...
Unauthorized, The input authorization token can't serve the request. As far as I know, the default valid timespan of the resource token is ......
Read more >
I got a message "The input authorization token can't serve the ...
I got a message "The input authorization token can't serve the request" when I called a container.replace_throughput method.
Read more >
Setting Up Authentication and Authorization with Apollo ...
Set up Apollo Gateway and an implementing service with a federated schema to manage access to user account data; Sign a JWT for...
Read more >
401 Unauthorized - HTTP - MDN Web Docs
This status code is sent with an HTTP WWW-Authenticate response header that contains information on how the client can request for the resource ......
Read more >
Self-Encoded Access Tokens - OAuth 2.0 Simplified
The main benefit of this is that API servers are able to verify access tokens without doing a database lookup on every API...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found