JWT
public struct JWT : Sendable
A JSON Web Token (JWT) to be used to authorize API requests.
The JWT is valid for 20 minutes, but will be renewed automatically when performing requests with BagbutikService
.
Full documentation for how JWT is used with the API: https://developer.apple.com/documentation/appstoreconnectapi/generating_tokens_for_api_requests
-
A value telling if the JWT has expired.
Declaration
Swift
public var isExpired: Bool { get }
-
The signature to use in the authorization header when performing requests.
Declaration
Swift
public private(set) var encodedSignature: String { get }
-
Create a new JWT.
Full documentation for how to get the required keys. https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
Declaration
Swift
public init(keyId: String, issuerId: String, privateKey: String) throws
Parameters
keyID
Your private key ID from App Store Connect; for example 2X9R4HXF34.
issuerId
Your issuer ID from the API Keys page in App Store Connect; for example, 57246542-96fe-1a63-e053-0824d011072a.
privateKey
The contents of your private key from App Store Connect. Starting with
-----BEGIN PRIVATE KEY-----
. -
Create a new JWT.
Full documentation for how to get the required keys. https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api
Declaration
Swift
public init(keyId: String, issuerId: String, privateKeyPath: String) throws
Parameters
keyID
Your private key ID from App Store Connect; for example 2X9R4HXF34.
issuerId
Your issuer ID from the API Keys page in App Store Connect; for example, 57246542-96fe-1a63-e053-0824d011072a.
privateKeyPath
The file path to your private key from App Store Connect.