Error trying to use a service account with GoogleDriveLoader
Labels: name: area: doc loader, name: auto:bug

### System Info

Name: langchain
Version: 0.0.251

Python 3.11.4

Docker image: tiangolo/uvicorn-gunicorn-fastapi:python3.11

### Who can help?

@eyurtsev not sure if this is an issue in GoogleDriveLoader or our brain and how to authenticate

### Information

- [X] The official example notebooks/scripts
- [ ] My own modified scripts

### Related Components

- [ ] LLMs/Chat Models
- [ ] Embedding Models
- [ ] Prompts / Prompt Templates / Prompt Selectors
- [ ] Output Parsers
- [X] Document Loaders
- [ ] Vector Stores / Retrievers
- [ ] Memory
- [ ] Agents / Agent Executors
- [ ] Tools / Toolkits
- [ ] Chains
- [ ] Callbacks/Tracing
- [ ] Async

### Reproduction

We are following the DeepLearning.ai short course on chatting with your documentation (https://www.deeplearning.ai/short-courses/langchain-chat-with-your-data/). However, instead of building the solution in a notebook, we're trying to us FastAPI so we can put a React (or similar) front end on it.

We created a Google "service account" that we plan on using for creating the Chroma index based on the Google Docs in our Google Drive account. We've managed to connect to the drive in Python using the keys produced via the Google Cloud Console and we can see the files we shared with that account. To be clear, this works (we can see the files printed to the console):

```
credentials = service_account.Credentials.from_service_account_file(
    os.path.join(os.path.dirname(__file__), '..', '.credentials', 'credentials.json'),
    scopes=['https://www.googleapis.com/auth/drive.readonly']
)
```

When we set the credentials_path to the credentials.json file in GoogleDriveLoader, we get an error. Specifically, the following code fails:

```
path_credentials = os.path.join(os.path.dirname(__file__), '..', '.credentials', 'credentials.json')

loader = GoogleDriveLoader(
    folder_id=os.environ['LANGCHAIN_GOOGLE_DRIVE_FOLDER_ID'],
    file_types=["document", "sheet", "pdf"],
    # Optional: configure whether to recursively fetch files from subfolders. Defaults to False.
    recursive=True,
    credentials_path=path_credentials
)
```

This is the error in the console:
```
raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS)
2023-08-04 13:52:02 google.auth.exceptions.DefaultCredentialsError: Your default credentials were not found. To set up Application Default Credentials, see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.
```

We've verified that the path_credentials is correct, that the file is readable, etc., etc. Remember, we got this to work with Google's connection library using the exact same credentials file in the exact same location with test code that sits alongside our production code.

We then set `ENV GOOGLE_APPLICATION_CREDENTIALS=/app/.credentials/credentials.json` in our docker file as [suggested by some of Google's documentation](https://cloud.google.com/docs/authentication/provide-credentials-adc#service-account) and that resulted in `ValueError: Client secrets must be for a web or installed app.`.

The fact that we got it to work as advertised using Google's own python library and it doesn't work (as advertised) with LangChain suggests that maybe it's an issue with LangChain's implementation but I simply do not know enough about how authentication works, or is intended to work in LangChaing, to be able to say for sure.

### Expected behavior

The expected behavior is, ultimately, a loader that can print a list of files. It works with the test code but not with LangChain.

I hope this bug report is useful and it's a problem on our end. TIA

- Similar https://stackoverflow.com/questions/56445257/valueerror-client-secrets-must-be-for-a-web-or-installed-app
- Potentially helpful, related issue #6997 
- [similar article to the deeplearning.ai course](https://www.haihai.ai/gpt-gdrive/)
- [another article that suggests similar things](https://blog.nextideatech.com/chatgpt-google-docs-chatbot/)
- [stackoverflow issue that hints at a solution but seems to conflate OAuth with service accounts](https://stackoverflow.com/questions/76408880/localhost-auth-for-langchain-google-drive-loader)