AvdLee / appstoreconnect-swift-sdk

The Swift SDK to work with the App Store Connect API from Apple.
Other
1.48k stars 198 forks source link

`invalidBase64EncodedPrivateKey` error #273

Closed marandaneto closed 6 months ago

marandaneto commented 6 months ago

Hi, thanks for the lib. I am trying to run this example: https://github.com/AvdLee/appstoreconnect-swift-sdk/tree/master/Example

    private let configuration = try! APIConfiguration(issuerID: "...", privateKeyID: "...", privateKey: 
"""
...
"""
    )

throws JWT.Error.invalidBase64EncodedPrivateKey

I did what was said here. Went to api and created a team key, copied the issuer id, key id, and downloaded the p8 file. copied the content from the p8 file without the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- parts.

did the private key format change maybe?

Thanks.

marandaneto commented 6 months ago

nvm I copied the content directly from sublime using multiline strings and that made it fail.