0

I have issue on connecting with my google drive API, when I run my script it suppose to transfer my files from my local drive/folder to my google drive... may I know what I need to modify or change to resolve the encountered issue?.

Error message: oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values in the JWT claim.

My Code

import os
from oauth2client.service_account import ServiceAccountCredentials
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive

SERVICE_ACCOUNT = 'mykey.json'
gauth = GoogleAuth()
scope = ['https://www.googleapis.com/auth/drive']
gauth.credentials = ServiceAccountCredentials.from_json_keyfile_name(SERVICE_ACCOUNT, scope)
drive = GoogleDrive(gauth)

folder = "213123123qweqweascasca"

rodskies
  • 119
  • 1
  • 11
  • Does this answer your question? [oauth2client.client.HttpAccessTokenRefreshError: invalid\_grant: Invalid JWT](https://stackoverflow.com/questions/49510330/oauth2client-client-httpaccesstokenrefresherror-invalid-grant-invalid-jwt) – Rafa Guillermo Jan 17 '22 at 08:46
  • I already found out the issue, my NTP service is not working. Anyway thank you for your help. – rodskies Jan 19 '22 at 03:35

0 Answers0