fastlane/fastlane

Individual API Key not supported

palmerc opened this issue · 4 comments

Issue Description

Attempted to use an Individual API Key for the Account Holder to manage the Developer ID Certificate. It is not possible to do so through a regular API Key.

Command executed

match with JSON key path

Complete output when running fastlane, including the stack trace and command used
[!] The request could not be completed because:
	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

Environment

I'm experiencing the same issue with fastlane@2.220.0. Normal Team API Key worked perfectly, but if I try to use an individual Key it fails on the upload_to_tesflight step.
app_store_connect_api_key step does not throw any error.
This is the error I get if I run with --verbose

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
Token has expired, issued-at-time is in the future, or has been revoked! Trying to refresh...

The process for generating a token from an Individual API Key is a little different, so the app_store_connect_api_key step will probably need changes. The important difference is that Individual API Keys don't use the iss key in the JWT payload, and requires the sub key instead.

https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests#4313913

same issue here

### Azure DevOps API Key Issues for deploying to Apple
To get this to successfully work on Azure DevOps Pipeline with an API Key. I ran into so many problems and tried everything I could find and this finally worked. Azure DevOps says you need use the base64 key. Well if you open up the .p8 and copy the base64 encoded string in there, that isn't what they want. They literally want you to copy all of the contenxt in the .p8 file to a base64 string. Don't modify the .p8 file. I found the solution at the follow source, and once you get the data.b64 file open it and copy the base64 string in that file. In the following article is discusses how to do this for Windows, Mac, and Ubuntu.

#21531 (comment)