Thank you for your message.
The code has nothing to do with it. So long as you have already added the connection to your address book and can see it online, you should be able to authorization.
From the error message we can say that something breaks the authorization routine midway. First of all please make sure that you update Viewer and Host to the most recent version (220.127.116.11 as of this writing).
If the issue persists even after you update the Host, feel free to send us the Host logs for examination. Here is how to locate the Host logs https://www.remoteutilities.com/support/docs/host-log/