How to login to an external website after drupal-login? I would like know how I can login my user to an external website after drupal-login please ?

I use :

    $xenAPI = new XenAPI('http://xen.dev/api.php', 'MY_API_KEY', 'MY_API_KEYSALT'); 
    $xenAPI-&gt;login('Kyna', 'secret_password', 'http://theming.dev');


The login work on all page when I use HOOK_user_load(), but if I use HOOK_user_login(), don't work. I don't have an error, but ->login() create a redirection with an header and I think drupal-login overwrite my header on external script or create a redirection before my script.
Yes, the login form has a redirection(see the \Drupal\user\Form\UserLoginForm::submitForm()), so you need to remove that redirection with $this-&gt;getRequest()-&gt;query-&gt;remove('destination').