by Hubert Chathi.
It sounds like you are looking for a Single Sign On (SSO) solution. Moodle supports a few different SSO protocols, including Shibboleth, Moodle Networks (Moodle's custom profile), and OpenID (via third-party plugins). It depends on what system www.mysite.it is running, and what SSO protocols (if any) it supports.
You would not be able to do this via AJAX, because the JavaScript would not have access to the credentials to log the user in.