Now I want my (Python) backend to be able to query the user’s Jira objects like projects or issues. When in standalone mode I have implemented OAuth and call the JIRA API, e.g. to get a list of the client’s projects:
https://fixedpm.atlassian.net/rest/api/3/project
What do I do to authorise this API call as the client who has installed my app?
JWT is the right way. The issue you linked is about Jira Server, not Jira Cloud.
What’s difficult is that Atlassian Connect’s JWT uses custom claims; specifically, the QSH (query string hash). Our docs tend to assume you will use one of the Connect frameworks in JavaScript or Java and don’t do a great job specifying the whole auth flow. Working in Python, I suggest my Connect JWT overview and using Bitbucket’s spec for QSH.
Thanks a lot Ian, your video was very informative.
I have worked out what I was doing wrong (at last!). As you say, when your backend is Python, the Connect App/JWT documentation is a little less helpful. For anyone else encountering the same problem I will set out the solution:
I am using the Python library at Bitbucket which is working OK, as long as you know that:
The ‘clientKey’ it wants is the ‘key’ you supplied in atlassian-connect.json, not the ‘clientKey’ field in the tenant info!
You also want to ensure that your parameters are supplied as part of the canonical_uri
Don’t feed the tenant_info block to the encode_token call as **tenant_info
Once I made that fix it works for URLs with or without parameters, and get and post methods.