Redirect to ERPnext with SSO

Hello everyone, if I want to redirect from others website to ERPnext, and they almost have same account, so after I login on others website and redirect to ERPnext it’s already login, just as SSO. To achieve this, I need to make a hook on ERPnext to receive data and I would like to do with ajax.
Is there anyone have idea? Maybe with code example! THXS very much!

For using accounts on Frappe server

Frappe allows Google, Facebook, Github and Frappe as social logins.