A simple API for your purpose is on https://developers.google.com/identity/sign-in/web/sign-in, it's just working in JavaScript. About the usability for your purpose it might be a challenge, as you have to save the users with their roles. At least you had additionally to include some requests to the server, at best by AJAX.
Then there exists a server-side API for OAuth-authentication, general deatails about it you can find here: Gmail Add-On: Oauth not being triggered, I answered there on a question but included info and several links.
Your question seems being very general but as there exists several APIs, perhaps additional ones beside my hints, so you should try finding the best solution for you - following the tags where you also get some links to google-authentication, but you should probably additional search by yourself for the different APIs as long as nobody else is giving a comprehensive overview.
Having made a decision for one API you should follow some examples and can ask again at best with some code you tried already to get answers on concrete programming-problems.