OAuth works in initializer but not as an action. Bug?

Hi - I have this post request going to Instagram’s basic display API:

When I get a valid code from the user authorization request and use that to initialize the request, everything works as expected.

But when I trigger this request in an action, I keep getting this error:

The service Instagram - IG Authenticate User just returned an error (HTTP 400). Please consult their documentation to ensure your call is setup properly. Raw error:

{"error_type": "OAuthException", "code": 400, "error_message": "Error validating verification code. Please make sure your redirect_uri is identical to the one you used in the OAuth dialog request"}

Even when I hard code the request parameters so that literally everything is the same as what I initialized with (except the access code), I still get this error. The redirect URL is exactly the same, so that doesn’t make any sense. Any ideas out there? Thanks!

As a suggestion in the setup of your redirect_uri items on the Instagram setup side include multiple options that include the same URL’s with and without ?debug_mode=true (for that matter also have options with version-test included and excluded in the path)

As your initialiser URL will have that parameter, but probably not when used in your actions.

Thanks @lindsay_knowcode - tried that and it didn’t do the trick, unfortunately.

After a night’s rest I decided to save the dynamic redirect_url to the DB before using it to generate the access code. Then I figured out a way to reference that value in the subsequent exchange (code for access token). That did the trick. There must be something weird about the way the request handled the way I was building the dynamic field in the workflow. For a hint: I was using arbitrary text. Maybe that was a bad choice. Either way, this solution I used seems to work fine. Thanks so much for the advice.

1 Like