I am trying to build a desktop Python3 application that will login to GMail and perform a few tasks. I have used the quickstart.py sample code given in the Google Developers Guide and it works perfectly. My application logs in and retrieves data.
However, after the program executes and terminates, the browser remains logged into GMail, unless the user specifically opens GMail on his browser and actually logsout. This is a security hazard as the user may forget to logout.
I am looking for way in which my python program will automatically log the user out before the program terminates. Will be grateful if someone can guide me on how this can be done.