My react codebase doesn't allow for the standard Plaid link due to CORS issues that I can't change.
So I've been initializing the Link flow by going straight to:
window.location.href = .html?token=${results.link_token}&redirect_uri=${redirect_uri}
;
This takes me to the link flow on Plaid's hosted version. The flow works. And at the end... nothing. Just a spinner. From what I've read this flow maybe isn't supposed to be accessed outside of an iframe where you can respond to results?
But I can't use an iframe. And a popup gets around the CORS issues but I can't listen to results.
Here's why I'm confused though. If you log the network call of the Plaid flow in it's own window you'll see at the end it produces a "redirect_uri". It's exactly what I need it to redirect to. Includes the final token parameters and everything. It's clearly constructed to be used.
If you copy and past that redirect_uri into the browser it successfully completes the process on my react app and exchanges the tokens on my server and such. But I have to manually grab it from the Network inspector and paste it into the browser every time...
So why wouldn't the Link flow, in it's own window, not attempt to redirect to the redirect_uri it has? Is there another parameter I can send initially so the Link knows it's in it's own window and should use it's own redirect_uri once it's done?
Why would that redirect_uri exist if it's never triggered?
My react codebase doesn't allow for the standard Plaid link due to CORS issues that I can't change.
So I've been initializing the Link flow by going straight to:
window.location.href = https://cdn.plaid/link/v2/stable/link.html?token=${results.link_token}&redirect_uri=${redirect_uri}
;
This takes me to the link flow on Plaid's hosted version. The flow works. And at the end... nothing. Just a spinner. From what I've read this flow maybe isn't supposed to be accessed outside of an iframe where you can respond to results?
But I can't use an iframe. And a popup gets around the CORS issues but I can't listen to results.
Here's why I'm confused though. If you log the network call of the Plaid flow in it's own window you'll see at the end it produces a "redirect_uri". It's exactly what I need it to redirect to. Includes the final token parameters and everything. It's clearly constructed to be used.
If you copy and past that redirect_uri into the browser it successfully completes the process on my react app and exchanges the tokens on my server and such. But I have to manually grab it from the Network inspector and paste it into the browser every time...
So why wouldn't the Link flow, in it's own window, not attempt to redirect to the redirect_uri it has? Is there another parameter I can send initially so the Link knows it's in it's own window and should use it's own redirect_uri once it's done?
Why would that redirect_uri exist if it's never triggered?
Share Improve this question asked Mar 6 at 1:48 Zach WhelchelZach Whelchel 1501 silver badge7 bronze badges2 Answers
Reset to default 0Is there a reason you're not just using the hosted_link_url
property provided by Plaid, rather than constructing the URL yourself? See https://plaid/docs/link/hosted-link/#integration-process for instructions on getting the URL. Using the Plaid Hosted Link URL should fix the issues you're seeing.
Use the Redirect URI Properly
Ensure that the redirect_uri is correctly configured in your Plaid dashboard and matches the URL where you want the user to be redirected.
Add the redirect_uri parameter when initializing the Link flow:
window.location.href =
https://cdn.plaid/link/v2/stable/link.html?token=${results.link_token}&redirect_uri=${redirect_uri}
;Contact Plaid Support
If above solutions didn't work, reach out to Plaid's support team. They might be able to provide guidance on how to handle this specific use case.