```in OSS i am using "abctl local credentials" com...
# releases
a
Copy code
in OSS i am using "abctl local credentials" command but while using it the client-id and client-secret in calling <http://localhost:8006/api/public/v1/source> i am getting  401 unauthorized error why is that?
can somebody please help on this?
j
I had the same issue, I am on the app version 1.8.5. When navigating to the UI where the client id should be visible, it does not appear, and also trying to see the secret, there is none. For a workaround try using the username and password if it is of any help for the time being.
a
lemme do that
what is the username though
the Email address?
j
Exactly
a
it works oh my god
why they havent updated the documentation 🥹
y
I just wanted to say a quick thanks, because this thread helped me solve the issue 🙌
💯 2
s
@Yoanna Kirilova / @Aadarsh Mahala any chance one of you is free to help me with the same? I've tried all sorts of combos of auth types and parameters but am failing miserably to use the api on a localhost instance running the open source version of airbyte 😞
a
first run "abctl local credentials" then after that whichever email you have provided during your download of Airbyte OSS use that as "client_id" and the password which you got from the running the command that is "client_secret" for the API
and then try it with either curl or postman
s
hmm, maybe the issue I have in that case, is that the email shows up as follows:
Copy code
SUCCESS  Retrieving your credentials from 'airbyte-auth-secrets'
  INFO    Credentials:
            Email: [not set]
            Password: myAutoPassword123
            Client-Id: abc123
            Client-Secret: def456
The
[not set]
might be the issue, however when trying to set it I get the following:
Copy code
ERROR   Unable to update the email address
ERROR   unable to udpate the email address: failed to update organization: unexpected status code: 401
1. the email does get updated 2. there's a spelling mistake in the log message 🙃
a
in UI what is the mail
you will see default mail
s
in the UI it's my email
<mailto:sunny@xyz.com|sunny@xyz.com>
, which is what I used in the Postman call to the token endpoint
though looking above, you're call the
/source
resource. I was hitting the
/token
endpoint to get an access token as per this instruction - https://docs.airbyte.com/platform/using-airbyte/configuring-api-access
also tried generating an initial access token from the Default application in the UI, and using that as a bearer token
I'm usually fine with OAuth flows but evidently I'm doing something wrong if you've got it working 😞
y
For me I didn't need to get a token to authenticate, since email and password are used instead of a token so I could send the API request directly. This is the python code I used that worked for me (in my case using it to trigger a sync)
Copy code
import base64
import requests

text = "email:password"
encoded_auth = base64.b64encode(text.encode()).decode()

url = f"<http://localhost:8000/api/public/v1/jobs>"
headers = {
    "Authorization": f"Basic {encoded_auth}",
    "Content-Type": "application/json"
}
payload = {
    "jobType": "sync",
    "connectionId": connection_id
}
response = requests.post(url, headers=headers, json=payload)
🙏 1
s
riiight, the known issue is resolved, and with the new version, auth is working fine now! Thank you both for the advice re endpoints and REST API calls.