This script (gmail_oauth2.py) is using OOB that it's beeing used was discontinued
(REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'). I created a script that generates de the token and the refresh token using google modern recommendations:
from google_auth_oauthlib.flow import InstalledAppFlow
SCOPES = ["https://mail.google.com/"]
credentials_path = input("CREDENTIALS_PATH: ")
flow = InstalledAppFlow.from_client_secrets_file(
credentials_path, # your credentials file from google, download it from gcp
SCOPES
)
creds = flow.run_local_server(port=8088)
print("TOKEN: ", creds.token)
print("REFRESH: ", creds.refresh_token)
I know it isn't too flexible for changes it is useful for who wants speed. I'm open for contributions. And hope this to help who get in google OOB issues.
Maybe after i'll make a pull request implementing this code as a functionality in gmail_oauth2.py script and with an upgraded readme.md.
This script (gmail_oauth2.py) is using OOB that it's beeing used was discontinued
(REDIRECT_URI = 'urn:ietf:wg:oauth:2.0:oob'). I created a script that generates de the token and the refresh token using google modern recommendations:
I know it isn't too flexible for changes it is useful for who wants speed. I'm open for contributions. And hope this to help who get in google OOB issues.
Maybe after i'll make a pull request implementing this code as a functionality in gmail_oauth2.py script and with an upgraded readme.md.