OAuth 2 and saving the authenticated user

It seems like you are insisting on making your life difficult. Implementing any type of API is error prone to the best of developers and real time sync can fail due to network errors, bugs etc, and I would be very hesitant before selecting such an option.

Using a network is probably the best option for several reason, but if you feel like it do not fit your needs, your other best alternative is to simply connect directly to the DB of site A to get the relevant information. In a way it is a variation on the API idea, but since it has only one authoritative source for the data and you will use battle tested protocols to retrieve the info, the chances of successful implementation are much higher.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)