Custom Auth - how to capture the url parameters in callback url

Hi all

I am trying to integrate with API service provider to retrieve bank balances from multiple banks. However, they are not using the standard OAuth2. This is a summary of the steps involved:

  1. API Request with client id and secret to get an access token
  2. Another API request to use the access token from #1, client ID, a Redirect URI. I will receive a link (URL) upon successfully authentication.
  3. Launch this link in a browser (the service provider suggests to use an iframe) received from #2. In the browser, I have to login and authenticate against the bank I want to extract the bank balances. It will generate "code" in the url parameters and send back to the redirect URI upon successful authentication.
  4. Another API call with this "code" from #3, with client_id and secret to get the access and refresh token for rest of the process.

I use custom authentication, and am able to complete step 1 - 3. But I am unable to find a way to capture the redirect URI and expose the url parameter (specifically I just need the "code").

Any help on how this can be done in Retool will be highly appreciated.

Regards,

Henry

1 Like

Hey @yikl - thanks for reaching out. Based on what you've described, I think the application at your redirect_uri would have to be responsible for capturing the code URL parameter. Is that a Retool app or something else?

1 Like

Hi Darren. We want to use a retool app to capture the redirectURI and extract the "code". Just wonder if this is possible?

I can't find any supporting documentation. The only thing seems possible is to use a webhook in a workflow but not sure how this can be achieved.

Regards,

Henry

In general, referencing url.searchParams from within your app will allow you to retrieve any search parameters, but I'm not sure how you would be able to chain this additional step onto the end of your existing custom auth flow.

1 Like

Let me explore. Thanks.

1 Like

Have you had a chance to review this, @yikl? Let me know if you have any questions!

1 Like

Thanks. Darren. Managed to find a way. I somehow created another page to capture the redirect URI and it works fine.