0

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: enter image description here

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.

thisNeil
  • 73
  • 1
  • 3
  • 11
  • Does calling [`setRedirectUri()`](https://github.com/infusionsoft/infusionsoft-php/blob/9b49e46c4954d3269019a988cae7b854cd362b30/src/Infusionsoft/Infusionsoft.php#L233) before `getAuthorizationUrl()` work? I don't remember if that's the OAuth redirect or the successful auth one. – Chris Haas May 13 '20 at 13:10
  • @ChrisHaas it seems that setRedirectUri modifies the same redirectUrl variable in the constructor. We can still try that suggestion and try to replicate the Redirect bug :) If it doesnt occur again, then it means your suggestion that worked. – thisNeil May 13 '20 at 13:22

0 Answers0