Remote Authentication for Support Desk - Script receiving 400

Remote Authentication for Support Desk - Script receiving 400

Currently trying to get this working from a development environment, redirecting to that URL from a different URL than the one provided in our Remote Login URL.

Script that is running:


> $ts = round(microtime(true) * 1000);
>
> $email = $this->getUser()->getEmail();
>
> $remoteauthkey = ''* removed>
>$fullname = $this->getUser()->getUser()->getName();
>
> $loginstripped = preg_replace('/[^a-z\d]+/i', '_', $fullname);
> $loginname = mb_strimwidth( $loginstripped, 0, 9).$this->getUser()->getUser()->getId();
>
> $operation = "signup";
>
> $utype = "portal";
>
> $inputlist = $operation.$email.$loginname.$fullname.$utype.$remoteauthkey.$ts;
> $inputlist = preg_replace('/\s+/', '',$inputlist);
>
> $apikey = md5($inputlist);
>
> $redirecturl = " https://support.easyrxortho.com/support/RemoteAuth?operation=" . urlencode($operation) . "&email=".urlencode($email) . "&ts=" . urlencode($ts) . "&fullname=" . urlencode($fullname) . "&loginname=" . urlencode($loginname) . "&utype=" . urlencode($utype) . "&apikey=" . $apikey . "&redirect=1";
>
>
> return $this->redirect($redirecturl);
>

At first there was some issues with the timestamp and we were getting error message 105 Request Delayed.

Now when I arrive at that redirected URL I get a 400 error in the console