iOS Auto Provision App Store Connect Step Always Fails

Every time we attempt to run the iOS Auto Provision App Store Connect API step we get the following error messaging. I appear to have all the access rights setup properly but keep getting the authentication error. The App Store Connect API Key is active and has Developer access rights. Is there anything else that Iā€™m missing?

From the build log (omitted keys, secrets, & whatnot):
Certificates required for Development: false; Distribution: true

Failed to log all Developer Portal certificates: failed to query certificates on Developer Portal: GET https://api.appstoreconnect.apple.com/v1/certificates?filter%5BcertificateType%5D=IOS_DEVELOPMENT&limit=20: 401

NOT_AUTHORIZED: Authentication credentials are missing or invalid.: Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens

Certificate (Serial: xxxx, Name: Apple Development: xxx (xxx), Team: xxxx, Expiry: xxxx) not found on Developer Portal: failed to fetch certificate (xxxx): GET https://api.appstoreconnect.apple.com/v1/certificates?filter%5BserialNumber%5D=xxxx: 401

NOT_AUTHORIZED: Authentication credentials are missing or invalid.: Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens

Certificate (Serial: xxx, Name: Apple Distribution: xxx), Team: xxx, Expiry: xxx) not found on Developer Portal: failed to fetch certificate (xxx): GET https://api.appstoreconnect.apple.com/v1/certificates?filter%5BserialNumber%5D=xxx: 401

NOT_AUTHORIZED: Authentication credentials are missing or invalid.: Provide a properly configured and signed bearer token, and make sure that it has not expired. Learn more about Generating Tokens for API Requests https://developer.apple.com/go/?id=api-generating-tokens

Failed to get valid certificates: not found any of the following IOS_DISTRIBUTION certificates on Developer Portal:

Serial: xxx, Name: Apple Development: xxx, Team: xxx, Expiry: xxx
Serial: xxx, Name: Apple Distribution: xxx, Team: xxx, Expiry: xxx

Turns out you need to give Admin access to the App Store Connect API Key for this to work. Developer level access is not enough. After I created a new key with admin access it was able to download everything.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.