Cross domain login

Enonic version: 7.2.2
OS: Linux

We have an idprovider app and want to once the user login through one domain he can be recognized by other domains/sites in the same enonic server, what is needed for it to happen? The issue happens when I try to use the function getUser( ) in a controller from another domain/site and the idprovider in config is set only for one of the domains.