"Invalid redirect uri" upon recieving code and being sent to /callback

Currently trying to integrate the OAuth 2 flow: Getting Started with OAuth2 - Keap Developer Portal

I’m receiving this error when the app redirects to this link: https://localhost:3002/api/auth/callback/keap?code=GASbEZOU&scope=full|mr887.infusionsoft.com&state=sxQER4eIk1IyWGfQ-3wNCiLBdJxyHxq0erYjnUwlEkw

I’m receiving the “code” properly, and yet immediately after I’m redirected to https://localhost:3002/api/auth/error?error=OAuthCallback, which is a fallback in my app that happens when there’s an issue with the OAuth Flow.

The error I get in my console is that it’s an invalid redirect uri.

What else can I do to debug this? It’s possible that it’s an issue with the library I’m using but I’m hoping to narrow down that there’s nothing I’m doing wrong on the Keap side first.

If you think it may be a problem with the library you’re using (the code running when the error happens) it would help to know what library that is. :blush: …and what language are you working in, PHP? And is there anything special in between (like you’re trying to make this work inside WordPress, or a framework like Laravel)??? I may be able to offer some advice, but honestly, you’d need to provide all the details.

Alternatively, you could contact the following web dev company. They built our software that connects our SaaS to Keap via OAuth2. We’re built on Ruby on Rails, but they don’t use anyone else’s library to do this, it’s all custom code (it’s their own library, so they really understand how OAuth2 works at Keap). They specialize in complex custom API work like this. If you have the budget for that level of support, try sending them a message on their contact form: Contact | Arsenal Web Systems