Attempting to programmatically access a JIRA Cloud instance, I followed the helpful tutorial up at https://developer.atlassian.com/cloud/jira/platform/jira-rest-api-oauth-authentication/
The very last section suggests the following header:
Pass the OAuth access token in the request header, not request body, when making requests: If you pass the OAuth data in the request body, it will return a “400 Bad Request” error for most methods. You must pass the data in the header instead, e.g. “Authorization: Bearer {access_token}“
Although the java app in the example can successfully reach my JIRA instance, I’m trying to understand / work at a lower level and so just tried to pass that in as a curl header flag:
% curl --verbose https://example.atlassian.net/rest/api/latest/issue/myissue-5 --header ‘Authorization: Bearer {61xcyqi…}’
However that leads to the response: {“error”: “Failed to parse Connect Session Auth Token”}
I’ve double-checked the token that I’m pasting in their from the java example’s config file, and the java app can still successfully reach my server. What else is needed in the HTTP headers to successfully pass the token through?