PipedreamHQ / PipedreamHQ/pipedream

Facebook Graph Api

Open
#20,958 1 comment 0 reactions 1 assignee Claimed by @sergio-eliot-rodriguez View on GitHub
bug triaged user request
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

### App
Facebook Graph Api

### Summary:
Custom OAuth Client (oa_M4i0OX) is recognized by validate API but ignored by the Connect iframe — the bring-your-own-app form still shows for facebook_graph_api even when oauthAppId is correctly passed

### Details:
SUMMARY
We registered a workspace-level Custom OAuth Client for facebook_graph_api
so end users can connect their Facebook Ads account without seeing the
"App ID / App Secret / Scopes" form. The OAuth Client is recognized by
Pipedream's API, but the Connect iframe still shows the form. Users still
have to paste credentials manually, defeating the point of Custom OAuth
Clients.

SETUP
- Workspace project ID: proj_Losp34K
- Project environment: production
- Custom OAuth Client ID: oa_M4i0OX
- Connector slug: facebook_graph_api
- SDK: @pipedream/sdk@3.0.1
- Iframe bundle: https://pipedream.com/_static/connect.883dea49.js
- Meta App ID: 2198081644343838 (Development mode, all 4 ads use cases
enabled)
- Meta App's Valid OAuth Redirect URIs includes
https://api.pipedream.com/connect/oauth/oa_M4i0OX/callback

OAUTH CLIENT FIELDS (entered in Pipedream dashboard)
- App: Facebook Graph API
- Client ID: 982165724459594
- Client Secret:
- Scopes: ads_management ads_read catalog_management business_management
pages_show_list

FRONTEND CODE
await pd.connectAccount({
app: "facebook_graph_api",
oauthAppId: "oa_M4i0OX",
onSuccess, onError, onClose,
});

We added console.log right at the SDK call site to confirm the value
reaches connectAccount. Output: "oauthAppId being passed: oa_M4i0OX".

EVIDENCE - PIPEDREAM'S OWN VALIDATE API
We called the same endpoint the iframe calls:
GET /v1/connect/tokens/{token}/validate?app_id=facebook_graph_api&oauth_app_id=oa_M4i0OX

The response includes:
- "oauth_app_id": "oa_M4i0OX" ← Pipedream IS recognizing it
- "project_id": "proj_Losp34K"
- "project_environment": "production"
- "success": true, "error": null
- "app.custom_fields_json": [client_id, client_secret, space_separated_scopes]
← form fields are STILL returned

When we call validate WITHOUT oauth_app_id, the response is identical
EXCEPT oauth_app_id defaults to "oa_00i7o2". Custom field array is
identical in both cases.

WHAT THE IFRAME CODE DOES (from connect.883dea49.js)
The iframe decides "form vs OAuth redirect" using only customFields.length:

const hasDescription = app.authType === "oauth"
&& app.customFieldsDescriptionMd;
const hasCustomFields = app.customFields != null
&& app.customFields.length > 0;
if (!hasCustomFields && !hasDescription) {
return this.oauthFlow(); // skip form
}
this.screen = "customFields"; // show form

oauth_app_id is NEVER referenced in this decision. Since
facebook_graph_api's connector spec ships 3 customFields, the iframe
always shows the form regardless of our Custom OAuth Client.

CONFOUNDING VARIABLES WE RULED OUT
We tested the same setup with:
- A second OAuth Client (oa_Q7i8RD) in a different workspace
- Project environment = development AND production
- Different external_user_id values
Result was identical in every variation — the form always shows. The
variable that matters is the connector spec, not our config.

WHAT WE WANT TO CONFIRM
1) Is there an OAuth Client config field we missed that suppresses
customFields? We've reviewed every field in your dashboard UI.
2) Is there a different SDK parameter or URL flag (skip_custom_fields,
connect_link, etc.) that bypasses the form when oauthAppId is set?
3) Is there a different Facebook/Meta connector slug we should use?
Public catalog only shows facebook_graph_api and facebook_pages.
4) If none of the above: please confirm that facebook_graph_api is
bring-your-own-app by design and customFields are mandatory even
with a Custom OAuth Client. We'll then implement direct Meta OAuth
on our side.

Happy to share Connect tokens, full validate API responses, or HAR
captures if useful.

### Screenshots:

![Screenshot](https://storage.tally.so/private/meta-ads-pipedream-support-ticket.md?id=P4GkBe&accessToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IlA0R2tCZSIsImZvcm1JZCI6Im5yampSdiIsImlhdCI6MTc3OTM2MTIyOX0.xE-HK_JTpLMVeYlS2U9P5PuEySQQaAmi98NpwVavTVw&signature=7c8f241fa72a076233272eb88a8bbd6501868aaaedf6b488ed7bba8f4518f59c)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.