Stack Exchange
Refreshing an expired access token after signing in Android application
I have implemented a sign in with Google in my Android application by following Google's guide :
https://developers.google.com/identity/sign-in/android/start-integrating
I was able to acquire access token, send it to my server , and verify it there using the following URL :
https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=XXXXXXX
This is how I get this token in Android :
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == RC_GET_TOKEN) {
        GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
        Log.d(TAG, "onActivityResult:GET_TOKEN:success:" + result.getStatus().isSuccess());

        if (result.isSuccess()) {
            GoogleSignInAccount acct = result.getSignInAccount();
            String idToken;
            if (acct != null) {
                idToken = acct.getIdToken();
            }

The problem is that this token expires very quickly. I don't want to make users to pick a google account every time it happens in my application. I want them to do it only once, save the token, and refresh it silently every time it expires(either on the client, or on the server).
Unfortunately, I haven't found any example or explanation of this pretty common flow. 
Could someone point me to the right solution?
Thanks a lot
