Hi team, I have set up Airbyte OSS locally using a...
# replication-troubleshooting
k
Hi team, I have set up Airbyte OSS locally using abctl. When I try to access the API to get an access token, I receive a 400 Bad Request error, even though I have provided the correct client ID and secret. • Airbyte version: 1.8.2 • Running on port: 8080 • Web app URL: http://localhost:8080/ I am able to log in to the Airbyte UI using my email and password, and from the Applications page I can see the default application and generate an access token. However, I am not able to see the client ID and client secret there. I am only able to retrieve the client ID and secret via abctl. (In the cURL request below, I have added placeholders to hide the actual client ID and secret, but in my setup I am passing the real values retrieved from abctl) Here’s the cURL request I’m using:
Copy code
curl --location 'http://localhost:8080/api/v1/applications/token' \
--header 'Content-Type: application/json' \
--data '{"client_id":"<placeholder_client_id>","client_secret":"<placeholder_client_secret>"}
k
Thanks for the details. Based on our docs, the correct way to obtain an access token for a Self-Managed (OSS) deployment is to POST your client_id and client_secret to your Airbyte webapp URL at /api/v1/applications/token. Your cURL target looks correct for http://localhost:8080. [[Configuring API](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access); [abctl reference](https://docs.airbyte.com/platform/deploying-airbyte/abctl#reference)] A few things to check: - Use the client_id and client_secret from abctl local credentials exactly as returned (no extra quotes/spaces/newlines). [[Quickstart auth](https://docs.airbyte.com/platform/using-airbyte/getting-started/oss-quickstart#part-4-set-up-authentication); [abctl reference](https://docs.airbyte.com/platform/deploying-airbyte/abctl#reference)] - Ensure you’re hitting your Airbyte webapp URL, not api.airbyte.com (Cloud). For OSS, it should be: POST http://localhost:8080/api/v1/applications/token with body:
Copy code
{
  "client_id": "YOUR_CLIENT_ID",
  "client_secret": "YOUR_CLIENT_SECRET"
}
[[Configuring API](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access)] - Token lifetimes: In OSS docs, tokens are short-lived (3 minutes). If you successfully get one from the UI button, that confirms the endpoint works. The 400 “Invalid client id or token” typically indicates a mismatch or invalid credentials. [[Configuring API](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access)] - If you don’t see client_id/secret in the UI Applications page: that can happen; you can still use the abctl-provided client-id/secret. abctl local credentials also lets you rotate credentials if needed: - View: abctl local credentials - Optionally set a new password (not required for API): abctl local credentials --password YourStrongPassword [[Quickstart auth](https://docs.airbyte.com/platform/using-airbyte/getting-started/oss-quickstart#part-4-set-up-authentication); [abctl reference](https://docs.airbyte.com/platform/deploying-airbyte/abctl#reference)] - If you installed via Helm/Kubernetes, verify the values in the airbyte-auth-secrets secret (client and password are base64-encoded). A mismatch between what abctl shows and what the server uses could cause 400s: - kubectl get secret airbyte-auth-secrets -n <YOUR_NAMESPACE> -o yaml - Decode to confirm they match your request. [[Authentication (deploy)](https://docs.airbyte.com/platform/deploying-airbyte/integrations/authentication)] Known issue: There’s an open GitHub issue where token generation fails with “Invalid client id or token” after abctl install, and some users report the Applications page missing the client-id. This matches your symptom. [[GitHub issue](https://github.com/airbytehq/airbyte/issues/65595)] Next steps to unblock: 1) Regenerate/refresh credentials via abctl and try again: - abctl local credentials (copy fresh client_id and client_secret) - Retry the POST with the fresh values. 2) If running in Kubernetes, ensure the secret values match what the server is using (as above), or set them explicitly via a secret and restart airbyte-server. [[Authentication (deploy)](https://docs.airbyte.com/platform/deploying-airbyte/integrations/authentication)] 3) If the issue persists on 1.8.2, it may be the bug from the issue above; consider updating to the latest patch, or follow that GitHub thread for a fix/workaround. [[GitHub issue](https://github.com/airbytehq/airbyte/issues/65595)] If you share the exact abctl local credentials output (redacting values) and the exact JSON body you’re sending, I can help double-check formatting.
k
Exact CURL: curl --location 'http://localhost:8080/api/v1/applications/token' \ --header 'Content-Type: application/json' \ --data '{"client_id":"61260ca6-8c55-4954-9c5e-52615547dac5","client_secret":"6GdXpzho9osfiHtJv6E4ueRYgkvjuSa9"}' Resposne: {"message":"Bad Request","_embedded":{"errors":[{"message":"Invalid client id or token","_embedded":{},"_links":{}}]},"_links":{"self":{"href":"/api/v1/applications/token","templated":false}}}
@kapa.ai
k
A message from kapa.ai
Thanks for the clear repro. Your request format and URL for OSS are correct: POST http://localhost:8080/api/v1/applications/token with body {"client_id":"...","client_secret":"..."}. [[Configuring API](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access)] Given you can log in and get a token from the UI but see 400 “Invalid client id or token” when using the abctl client credentials, this matches a known issue where the Applications page may not show a client ID/secret and the server rejects abctl-provided credentials. [[GitHub issue](https://github.com/airbytehq/airbyte/issues/65595)] Recommended steps: - Re-fetch credentials and retry: - abctl local credentials (copy client-id and client-secret exactly). [[abctl reference](https://docs.airbyte.com/platform/deploying-airbyte/abctl#reference)] - Retry the POST with those values. [[Configuring API](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access)] - If using Kubernetes, verify the server’s credentials match what you’re sending: - kubectl get secret airbyte-auth-secrets -n <YOUR_NAMESPACE> -o yaml, then base64-decode instance-admin-client-id and instance-admin-client-secret and compare. [[Authentication](https://docs.airbyte.com/platform/deploying-airbyte/integrations/authentication)] - If they don’t match, set them explicitly via a Secret and restart the airbyte-server pod, or reinstall with abctl using your secret: - Create secret.yaml with instance-admin-client-id/secret; apply with kubectl or abctl local install --secret secret.yaml. [[Authentication](https://docs.airbyte.com/platform/deploying-airbyte/integrations/authentication)] - If the problem persists on 1.8.2, it’s likely the open bug above; consider updating to the latest version or follow the issue for a fix/workaround. [[GitHub issue](https://github.com/airbytehq/airbyte/issues/65595)] Quick cURL example (for OSS on localhost:8080):
Copy code
curl -sS -X POST 'http://localhost:8080/api/v1/applications/token' \   -H 'Content-Type: application/json' \   -d '{"client_id":"YOUR_CLIENT_ID","client_secret":"YOUR_CLIENT_SECRET"}'
[[Configuring API](https://docs.airbyte.com/platform/using-airbyte/configuring-api-access)]
y
Hi @Karthik I am having the same Airbyte API issue, and was wondering if you were able to solve the problem