Single sign-on: wp_authenticate_user vs wp_authenticate
I have a wordpress site (lets call it site1) and another site with oauth2 (site2).
When a new user is created, a record is created in both site1 and site2 databases with the same email as username, the typed password hashed in site2 database and a dummy (e.g. "pass") password for site1 database. Then login action authenticates with site2 database using a RESTfull API. If authentication is successful, I want to programmatically log the user in to site1 (wordpress), if not, an error object should be injected to site1.
My question is which wordpress filter is more suitable for this, wp_authenticate_user or wp_authenticate and where should wp_signon fit in?
Topic authentication single-sign-on security Wordpress
Category Web