When using the "Initiate OAuth for Source" on Face...
# airbyte-api
b
When using the "Initiate OAuth for Source" on Facebook Marketing, after Source Creation, I try to test using the Airbyte's Dashboard, and says that has Invalid Credentials. Is that correct?
j
That is not correct, can you walk me through the steps you took to authenticate and create your source?
b
@Jon Tan (Airbyte) The process is the following: 1. My customer access our Dashboard and click to create a new Facebook Integration; 2. Our backend generates the authentication URL using Airbyte's API (Initiate OAuth Source); 3. User get's redirected into Facebook page and authorize the Airbyte's FB application; 4. User gets redirected into my application page, containing the Secret ID in the URL; 5. For my application, I need to fetch all of his ad accounts, so this is now specific into my application. Now we clicks to fetch the list of all his ad accounts; 6. He gets redirected into Facebook again, and authorize My Application FB App; 7. Return to the page, with now the Secret ID from Airbyte and all his ad accounts IDs; 8. My backend use the same secret to create for those N ad accounts;
j
Am I understanding correctly that in step 5/6, you have your own facebook marketing application that you're using to redirect the user to facebook and authorize/fetch account IDs? Can you also provide me your connection ID? It should be in the URL of your page where you have the connection open in the UI.
b
@Jon Tan (Airbyte) Yes, instead of asking user to manually fill all his Ad Accounts IDs, I did that way. I didn't setup a connection yet, but the source ID is:
bb4fd7b7-cae2-416f-9f65-e94271cc7738
Did you identified the problem @Jon Tan (Airbyte)? I need to get this working because I've already some customers to onboard
j
I think I might know what's going on. Can you send me the request you used to create the source?
I had to step out, but based on what I looked at, it seems you may have passed your secret in as the access token in the source configuration. When you create the source, you'll need to create it with the secret ID passed in the
secretId
parameter outside of the connection configuration, not in the access_token parameter within the configuration. Give that a try if you're working on this before I'm available in the morning. Also happy to jump on a quick call to resolve this and make sure you're able to create your sources. As an example see this:
Copy code
{
    "configuration": {
        "include_deleted": False,
        "fetch_thumbnail_images": False,
        "page_size": 100,
        "insights_lookback_window": 28,
        "max_batch_size": 50,
        "action_breakdowns_allow_empty": True,
        "sourceType": "facebook-marketing",
        "account_id": "111111111111111",
        "start_date": "2017-01-25T00:00:00Z",
        "access_token": "ACCESS_TOKEN"
    },
    "secretId": "SECRET_ID"
}
b
@Jon Tan (Airbyte) What value should I use in Access Token?
It worked, thanks @Jon Tan (Airbyte)
j
Perfect - the access token in this case doesn't matter if you're passing in a secret. For future reference, the guide doc for creating OAuth sources has a note which says that if you're using a secret to create the source, some configuration might not be required. Essentially the secretId is used instead of you needing to supply any of the fields marked as
airbyte_secret=true
in the connector's specification. Here's a link to that section of the doc: https://reference.airbyte.com/docs/creating-oauth-sources#source-creation Let me know if you run into other trouble, happy to take a look and help resolve.