Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plaid Quickstart Issues (Java)

I am trying to implement Plaid using the sample code provided on the Java Quickstart [sandbox] and am getting issues when I show the Plaid Dialog (javascript). I am able to successfully get a link_token, but I'm never able to show the dialog. It spins for a brief second, then shows me:

oauth uri does not contain a valid oauth_state_id query parameter. Request ID: DBoT92FCo8AORay

I have tried this with an empty redirectUri, as well as "http://localhost:8080/plaid_test.html", which is registered in my developer account.

I am a bit stuck and hoping someone can direct me in the right direction. I've tested with both versions 9.10.0 and the latest (11.9.0).

Curiously, I am able to get the Java Quickstart working directly, but ONLY if I leave the .env PLAID_REDIRECT_URI blank. If I put localhost in there, it fails when trying to get the link token.

Does anyone have any suggestions on how to overcome this setup issue?

Thank you!

like image 322
Evan Ruff Avatar asked May 13 '26 17:05

Evan Ruff


1 Answers

I got this error (oauth uri does not contain a valid oauth_state_id query parameter) while creating a new test application in Plaid's Sandbox environment.

Important note: My application does not use OAuth.

The problem turned out to be, in my configuration parameters being passed to usePlaidLink, I was including a receivedRedirectUri key-value pair. Removing that key-value pair entirely resolved the issue for me.

In other words, my React component looked something like:

import { usePlaidLink } from 'react-plaid-link';

function PlaidLink(props) {
    const onSuccess = React.useCallback((public_token, metadata) => {
        // ...
    });

    const config = {
        token: props.linkToken,
        receivedRedirectUri: window.location.href,
        onSuccess,
    };

    const { open, ready } = usePlaidLink(config);

    // ...
}

Removing the line with the receivedRedirectUri was the solution for me, getting me past the oauth uri does not contain a valid oauth_state_id query parameter error, and getting the Plaid Link UI to appear in my app successfully.

This Plaid article, which has a number of mentions of "OAuth state ID" (as mentioned in the error message), helped point me toward this solution.

like image 101
Jon Schneider Avatar answered May 16 '26 07:05

Jon Schneider



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!