I am making an android app for tracking progress in premade tasks from a server. The app will create local profiles and download the tasks from the server, and save any progress the user makes (when they tick having done sub-tasks). What I want to do is be able to upload this progress back to the server to sync across devices. At first I created user accounts, and a random token to authenticate against the server after initial logon, to prevent saving passwords on the client. But then I figured I could use something like OAuth2 to login on the app with my google account, and then use the ID/email-address provided by Google to save the information on my server.
The problem is I can't figure out how to correctly set this up. I could easily just login, send the email to the server and save the data on that ID. The problem is what Google Token do I save? What should I save on the client side and send with the API-request to authenticate later? How / do I have to refresh the token?
All I want is a way to use OAuth from Google to authenticate the communication between the client and server...
NB: I am not going to use the Google OAuth for anything except auth and retrieving the users email-address.. (No Google API or anything..).