Hey @taktem,
Thanks so much for posting on the Apple Developer Forums!
I had never worked on this before now so I was tinkering around and I think I found what could be holding you up (or at least what held me up).
The first issue that I ran into when trying to figure this out was that the App Store Connect API documentation appears to need some updating. I have filed a feedback for this (FB10036380). You will need to update your "scope" to the below code example.
“scope”: [
“GET /builds/{id}/app”
]
Currently, including the /v1
as a part of the scope path will return an error from the App Store Connect API which does not match their documentation. By removing the /v1
things started to work for me.
There are many ways to accomplish what to put in the scope path, and I have not fully tested if the API accepts wildcards, but in this specific example, you would need to have some information beforehand or you would need to dynamically generate tokens on the fly and return them to the system wanting to make a request. A bit past the scope (no pun intended) of this response but I will give you one example.
In order to limit the scope of the Read the App Information of a Build API, you would first need to know all of the Build IDs and include those in the array of the scope permissions. To do this, you would need a JWT without a scope limitation to hit the List Builds API and then find the IDs from the response and generate a new JWT to be exchanged for a token.
Below is an example of what this would end up looking like (IDs are fake and generated by uuidgen
).
“scope”: [
“GET /builds/4E01297D-1D43-4020-B21C-9DC94A40579B/app”,
“GET /builds/A72021D3-8712-445D-9585-B847BBCCA362/app”,
“GET /builds/65E73521-ED9A-4F06-9C5D-44B54BB34ED6/app”,
“GET /builds/1FAC0D8D-4FD5-4ECD-9B84-D1422ADE3003/app”
]
There are many ways to go about achieving what you are looking to do so I would explore how to implement this logic upstream as a part of an initial request, but that is just how I like to build things.
Hopefully this helps and happy coding!