-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Low
-
Component/s: Page - Content APIs
-
None
-
6
-
Severity 3 - Minor
Issue Summary
When passing the header 'Authorization: <api-token>' to the following endpoint:
/wiki/api/v2/pages
We encounter the error:
{"errors":[{"status":404,"code":"NOT_FOUND","title":"Not Found","detail":null}]}
We should only get a 404 if the user is actually authenticated, but doesn't have access. In this situation, authentication has failed.
Steps to Reproduce
- Run the following cURL command:
curl --request POST \ --url 'https://<instance>.atlassian.net/wiki/api/v2/pages' \ --header 'Authorization: <api-token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "spaceId": "XXXXX", "status": "current", "title": "This is a test", "parentId": "XXXXXX", "body": { "representation": "storage", "value": "<p>test</p>" } }'
- You will receive the error
{"errors":[{"status":404,"code":"NOT_FOUND","title":"Not Found","detail":null}]}
- Modify the Headers with Authorization Basic "<EMAIL>:<API_TOKEN>" encoded to base64.
--header 'Authorization: Basic <base64 encoded credentials>'
- The call will be completed successfully
Expected Results
The response should return a 401 unauthorized since the authorization header only contains the token and not the base64 encoded credentials.
Actual Results
The response returned is a 404 NOT_FOUND.
Workaround
Ensure you are passing 'Authorization: Basic <base64 encoded credentials>'.