PipedreamHQ / PipedreamHQ/pipedream

[BUG] The Submit an App UI is unable to handle OAuth 2.0 flows that return the Authorization Code via an URL Fragment

Open
#15,906 0 comments 0 reactions 0 assignees View on GitHub
bug tracked internally triaged
Dominant language
JavaScript
Stars
11.7k
Forks
5.8k
Avg merge
3d 10h
Merged PRs (30d)
102

Description

**Describe the bug**
In the Submit an APP UI, when working with OAUth 2.0 flows, the flows fails when attempting the Access Token request if the previous Authorization request steps uses a URL Fragment to return the authorization code.

When the authorization code is returned as URL fragment, the URL received by the Submit an APP UI dialog shows like

`https://api.pipedream.com/connect/oauth/oa_g2oiMZ/callback#code=383FA778CAB43ACE3E1903E797B8B97970EDE6EA64737B73EB95ABBFE1F6EAC8`

As you can see, the value for the code parameter is returned after the "#" character, this is what specifies an URL fragment

but

Fragment identifiers are not sent to the server. The hash fragment is used by the browser to link to elements within the same page.

So the submit an app UI, is unable to extract the "code" value for the upstream steps and fails with value

[✗] do not have an oauth code/token to continue oauth flow with

**To Reproduce**
Steps to reproduce the behavior:
1. Go to the submit an app UI
2. Fill data and custom field with place holder values, it doesn't matter
3. in the authentication strategy enter client id, client secret, scopes, for an app that returns the authorization code via an URL Fragment, such as Mindbody
4. Setup the authorization and access token request
5. Hit the "Test up until accessToken request" button
6. Note that the accessToken request steps returns the error "[✗] do not have an oauth code/token to continue oauth flow with"

**Expected behavior**
The OAuth 2.0 flow runs the accessToken request.

**Screenshots**
Screenshot of the submit an app ui's oauth dialog, where returns the error being flagged:

Image

**Desktop (please complete the following information):**
- OS: Windows 11
- Browse Chrome
- Version 134.0.6998.37 (Build oficial) (64 bits) (cohort: Control)

**Additional context**
I have a test appslug setup reproducing the bug at
https://pipedream.com/submit-an-app/test_apps_for_checking_something_002?tab=auth-strategy

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.