You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With this setup, the GoogleDriveLoader() creates a local auth server during local development that always uses a random port. This leads to the problem that my redirect url that I configured in the Google Cloud never works. So I'm wondering why this class creates a local server and if so, why can't we set the port ourselves?
The code which creates this behavior is in line 191:
ifnotcredsornotcreds.valid:
ifcredsandcreds.expiredandcreds.refresh_token:
creds.refresh(Request())
elif"GOOGLE_APPLICATION_CREDENTIALS"notinos.environ:
creds, project=default()
creds=creds.with_scopes(SCOPES)
# no need to write to fileifcreds:
returncredselse:
flow=InstalledAppFlow.from_client_secrets_file(
str(self.credentials_path), SCOPES
)
# Why do we set port 0 -> leads to random port? # Why do we create a local server?creds=flow.run_local_server(port=0)
withopen(self.token_path, "w") astoken:
token.write(creds.to_json())
I can solve this issue by setting the port to my preffered one eg 8080. Anyone who has an idea?
The text was updated successfully, but these errors were encountered:
let's maybe add a parameters with a default value, and throw a meaningful erorr description if the port is occupied?
it would be awesome if you could work on that, thanks!
Hi everyone,
I started to work with the GoogleDriveLoader() and I recognized that there might be an issue with the oauth flow. Let's assume the following setup:
.env file:
GOOGLE_APPLICATION_CREDENTIALS=""
main.py:
With this setup, the GoogleDriveLoader() creates a local auth server during local development that always uses a random port. This leads to the problem that my redirect url that I configured in the Google Cloud never works. So I'm wondering why this class creates a local server and if so, why can't we set the port ourselves?
The code which creates this behavior is in line 191:
I can solve this issue by setting the port to my preffered one eg 8080. Anyone who has an idea?
The text was updated successfully, but these errors were encountered: