2 WordPress sites with 2 databases but sharing the same users

It’s not possible in WordPress to have shared users between 2 separates installations on 2 separated databases.

It could be possible just by hardcoding:

  1. hardcode WP_User class connect to other database and retrieve users
    from there
  2. hardcode get_metadata() function, that for wp_usermeta table connect to other database and retrieve users from there

but mentioned solution is not recommended of course, because it’s not updateproof.