We're connecting our Laravel PHP app to Infusionsoft, and its already set with the proper authentication stated in this guide.
Our coded ended up looking like this:
$Infusionsoft = new Infusionsoft(array(
'clientId' => $INFUSIONSOFT_clientid,
'clientSecret' => $INFUSIONSOFT_clientsecret,
'redirectUri' => $INFUSIONSOFT_redirectUri
));
...
if ($Infusionsoft->getToken()) {
...
} else {
return [
'success' => false,
'result' => $Infusionsoft->getAuthorizationUrl() // Redirect to Infusionsoft login
];
}
So far, it works. We get redirected to Infusionsoft's login page (and then choosing an account later on).
However, occasionally we get redirected to this other page instead:
We're pretty sure that the getAuthorizationUrl() that we got is the same for both when it works and when it get redirected somewhere else.
Is there another necessary parameter that we need to add in order to prevent this from happening? Even thought it happens occasionally, it would be nice that our user won't have to wonder why he's redirected there.