I see that it’s mentioned in the link quoted - but that’s not much more informative. You seem to have something specific in mind, that’s why I’m asking.
Thomas
Basically, oauth2 is a formalized process of doing what you found on Google BUT you can do it with multiple sites and the hard code has been written.
You don’t wanna lock yourself into one site (i.e. google) as users may not have an account on that site. Case in point, I recently downloaded an app that required a FB account and I dumped FB years ago. With no other way of creating an account I had no choice but to delete the app.
By using oauth2, you can more easily navigate a myriad of services: google, Facebook, Twitter etc. AND the code would be easier to implement.