Why am I encountering a 403 Forbidden error when integrating Google Drive with my app using Pipedream Connect?

This topic was automatically generated from Slack. You can find the original thread here.

Hey I’m integrating Google Drive with my app using Pipedream Connect and running into a problem

I created my own Google OAuth client (in testing mode), plugged the client ID and secret into Pipedream as a custom OAuth client, and set the redirect URI to Pipedream’s callback URL. I’ve verified that:
• The redirect URI matches exactly in Google Cloud and Pipedream
pipedream.com is listed in my OAuth consent screen’s authorized domains
• The scopes match (for Google Drive it’s https://www.googleapis.com/auth/drive
• I’m passing in the OAuth App ID to connectAccount on the frontend
When I try to connect a Google Drive account via Pipedream Connect from my local dev environment, the Google auth screen appears, and Drive shows that my app is connected (I can verify this in my Google account). But back in Pipedream, the connection fails with a 403 Forbidden error.

Is there anything else I should check? Workspace id is o_ZjIM98L

If you remove oauthAppId from connectAccount does that change anything?

Can you show me the code for createConnectToken and connectAccount?

no difference if i remove oauthAppId from connect account. here’s the full code:

Wait are you still getting a 403?

Nope, it works if i don’t pass in oauthAppId

Okay, this was confusing to me:

no difference if i remove oauthAppId

Can you share an example of an oauthAppId value?

That’s non sensitive

for gdrive it’s oa_dzi7zY

When you do pass it in connectAccount, can you look at the network call to

https://api.pipedream.com/v1/connect/tokens/ctok_{connect-token}/validate?app_id={app-slug}

in your browser?

does my oauth app need to be published and not in testing mode?

And can you paste the response of that network call here?

does my oauth app need to be published and not in testing mode?
There’s no concept of published vs testing in Pipedream — do you mean in Google? If so, I don’t think that’d be impacting this screen.

yeah i meant in google

here’s the network call response it’s making to

https://api.pipedream.com/v1/connect/tokens/ctok_2d.../validate?app_id=google_drive&oauth_app_id=oa_dzi7zY

{
    "app": {
        "id": "app_1lxhk1",
        "name_slug": "google_drive",
        "name": "Google Drive",
        "auth_type": "oauth",
        "description": "Google Drive is a file storage and synchronization service which allows you to create and share your work online, and access your documents from anywhere.",
        "img_src": "https://assets.pipedream.net/s.v0/app_1lxhk1/logo/orig",
        "custom_fields_json": "[]",
        "categories": [
            "File Storage"
        ],
        "featured_weight": 1000000096,
        "connect": {
            "allowed_domains": [
                "[www.googleapis.com](http://www.googleapis.com)",
                "[drive.googleapis.com](http://drive.googleapis.com)"
            ],
            "base_proxy_target_url": "https://www.googleapis.com",
            "proxy_enabled": true
        }
    },
    "oauth_app_id": "oa_dzi7zY",
    "success_redirect_uri": null,
    "error_redirect_uri": null,
    "success": true,
    "error": null,
    "project_environment": "development",
    "project_app_name": "DrawOS",
    "project_support_email": "[s@drawos.io](mailto:s@drawos.io)",
    "project_id": "proj_W7sDDZE"
} 

Oh actually the verification process on Google’s end could be the issue here

I forget their publishing options, can’t you set it to internal or something?

hmm i get this if i set it to internal

the weird part initially is that the connection does get set on googles side, but it’s pipedream that throws the 403 forbidden

Can you try adding these scopes to your OAuth client config in Pipedream?

email
profile