I've done a bit of experimentation in this area. Check out https://lastlogin.net/.

You may also be interested in the FedCM protocol Google is working on.