Sai Saran Kalugutla
09/23/2026, 7:27 PMkapa.ai
09/23/2026, 7:27 PM400 Client Error: Bad Request when requesting a token from https://appleid.apple.com/auth/oauth2/token indicates an authentication failure with your OAuth credentials rather than an issue with the connector itself [Amazon-Seller-Partner Connection Error].
For Apple Ads (Apple Search Ads), Airbyte uses a two-legged machine-to-machine OAuth flow using a Client ID and a generated Client Secret [Unique Connector Behaviors]. When Apple's token endpoint returns a 400 Bad Request, it usually means one of the following:
1. The Client Secret is invalid, malformed, or expired ⢠Expired Client Secret: The client_secret required by Apple is a self-signed ES256 JWT. Apple restricts the maximum expiration (exp) of this JWT to 180 days. If the JWT has expired, requests to the token endpoint will fail [Unique Connector Behaviors].
⢠Incorrect JWT Format: Ensure that the client secret has been generated properly according to Apple's specifications (signed using your private key and matching the public key registered in Apple Ads) [Setup guide; Unique Connector Behaviors].
2. Mismatch between Client ID and Client Secret ⢠Ensure the Client ID entered into Airbyte exactly matches the API user/application credentials under which the public key was uploaded and the secret was generated [Setup guide].
How to resolve: 1. Follow Apple's documentation on Implementing OAuth for the Apple Ads API to generate a fresh ES256 client secret JWT [Setup guide; Unique Connector Behaviors].
2. Re-enter the valid Client ID and newly generated Client Secret in your Airbyte source configuration [Setup guide]. š 0 button š 0 button ā¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.Sai Saran Kalugutla
09/23/2026, 7:28 PMSai Saran Kalugutla
09/23/2026, 7:28 PMkapa.ai
09/23/2026, 7:28 PM400 Bad Request from https://appleid.apple.com/auth/oauth2/token, double-check the specific technical requirements for the Client Secret and connector setup:
1. Client Secret JWT generation requirements The client secret for Apple Ads is not a simple string or API key; it must be a signed ES256 JSON Web Token (JWT) [Unique Connector Behaviors]. If any parameter in the JWT header or payload is wrong, Apple's OAuth server will reject the token request with a `400 Bad Request`:
⢠Key algorithm: The private/public key pair must be generated using the ECDSA P-256 (prime256v1) curve, and the token signed with the ES256 algorithm [Unique Connector Behaviors].
⢠Expiration (exp): Apple enforces a strict maximum lifetime of 180 days on the JWT [Unique Connector Behaviors]. Ensure the exp claim does not exceed 180 days from the issue time (iat).
⢠Required Claims: Verify against Apple's Implementing OAuth for the Apple Ads API that all headers (alg, kid) and payload claims (sub, aud, iss, etc.) strictly match the values associated with your Apple Ads API user and key ID [Setup guide; Unique Connector Behaviors].
2. Verify Airbyte configuration inputs ⢠No extra whitespace: Check that no accidental leading/trailing spaces or line breaks were introduced when pasting the client_id or the long client_secret JWT string into Airbyte.
⢠Client ID: Ensure you are passing the exact client_id associated with that public key/API user in the Apple Ads account [Setup guide].
⢠Token Refresh Endpoint: Unless you are proxying requests through a custom gateway, ensure the Token Refresh Endpoint setting is left at its default value:
https://appleid.apple.com/auth/oauth2/token?grant_type=client_credentials&scope=searchadsorg [Setup guide; manifest.yaml].
3. Verify the token request manually To isolate whether the issue is with the token generation or Airbyte, test exchanging the client secret directly using a tool like `curl`:
curl -X POST "https://appleid.apple.com/auth/oauth2/token?grant_type=client_credentials&scope=searchadsorg" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=<YOUR_CLIENT_ID>" \
-d "client_secret=<YOUR_GENERATED_JWT>"
Apple will return a JSON error response body (such as {"error":"invalid_client"}) detailing why the token request was rejected. š 0 button š 0 button ā¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.Sai Saran Kalugutla
09/23/2026, 7:32 PMkapa.ai
09/23/2026, 7:32 PM{"error": "invalid_client"} response directly from Apple's OAuth server indicates that Apple failed to authenticate your client credentials [Troubleshooting Common OAuth Issues].
When using the Apple Ads connector, this error typically occurs due to one of the following:
1. Incorrect Client ID or Mismatch:
⦠The client_id entered does not exactly match the Client ID assigned to the API user in your Apple Ads account [Troubleshooting Common OAuth Issues; Setup guide].
⦠Verify that there are no extra spaces, characters, or typos when copying and pasting the Client ID into Airbyte.
1. Issues with the Client Secret JWT:
⦠Key Mismatch / Wrong Key: The JWT was signed with a private key that does not match the public key currently uploaded for that API user in the Apple Ads account [Setup guide; Unique Connector Behaviors].
⦠Incorrect JWT Claims or Headers: In the self-signed ES256 JWT, claims such as sub (subject), iss (issuer), aud (audience), or the header key ID (kid) must strictly match Apple's specifications for that API user [Unique Connector Behaviors]. If any value is incorrect, Apple marks the client as invalid.
⦠Expired Token: Apple restricts the expiration (exp) claim on the JWT to a maximum of 180 days [Unique Connector Behaviors].
How to resolve: ⢠Re-check your API user setup in Account Settings ā User Management in Apple Ads [Setup guide].
⢠Re-generate the ES256 JWT using the correct private key, ensuring all claims (sub, iss, aud, kid) match Apple's requirements, and update the Client ID and Client Secret fields in Airbyte [Setup guide; Unique Connector Behaviors]. š 0 button š 0 button ā¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.Sai Saran Kalugutla
09/23/2026, 7:49 PMkapa.ai
09/23/2026, 7:49 PMclient_id changes each time you generate a new client_secret.
According to the setup guide, the client_id is tied to the API user role created under Account Settings ā User Management in Apple Ads [Setup guide]. Because the client_secret is a self-signed ES256 JWT generated from your key pair, refreshing or re-signing an expired or updated JWT typically uses the existing API user's credentials rather than creating a new client identity [Unique Connector Behaviors].
However, for the exact behavior regarding key rotation and user management on Apple's platform, please refer to Apple's guide on Implementing OAuth for the Apple Ads API [Setup guide]. š 0 button š 0 button ā¹ļø Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.