burnash / burnash/gspread

ADC Authentication

Open
#1,440 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
7.5k
Forks
979
PR merge metrics
No merged PRs in 30d

Description

I know this has been somewhat asked before but the related answers are quite old and some of the solutions no longer apply (i.e Google Drive API is no longer required)

How would this work with local Application Default Credentials(ADC) during development? ( i.e using gcloud auth application-default login).

```
from google.auth import default
creds, _ = default()
gc = gspread.authorize(creds)

print(type(creds))
```

I get "google.oauth2.credentials.Credentials" for the type

In deployment, I use a service account.

As a note: with [GCSFS](https://github.com/fsspec/gcsfs) when using cloud storage this just works, trying to see what I'm doing wrong here.

Also, I have already tried using the service

`gc = gspread.service_account(filename="./*.json") `

and everything works

Contributor guide

Open the contributing guide

Research direction

Start with the issue's google.auth.default() and gspread.authorize() example, then compare it with gspread.service_account() and the GCSFS authentication behavior. Reproduce the local setup using gcloud auth application-default login; done means the supported ADC workflow and any missing requirement are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.