googleapis / googleapis/google-api-nodejs-client

Unexpected Unauthorized response for google drive client.

Aperta
#3,323 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
priority: p3 type: question
Lingua principale
TypeScript
Stelle
12.2k
Fork
2k
Merge medio
1g 9h
PR unite (30g)
24

Descrizione

### Environment details
---
- Node.js version: 20.5.0
- npm version: 9.8.0
- `googleapis` version: 126.0.0

### Unexpected behaviour description
---
I'm getting a **401 response** when calling `service.files.create()` for a multipart upload using expired credentials. Same code works for other methods as `drive.files.list()`, also executing `drive.files.list()` before `service.files.create()` makes the second call work as expected (See attached code snippet for details).

![carbon](https://github.com/googleapis/google-api-nodejs-client/assets/15835905/e9357127-f238-4551-9673-3219ba291e59)

### Steps to reproduce
---

1. Setup expired credentials for the example code provided.
2. Run the app without params to see get the 401 response. `node .\index.js`
3. Run the app with --all arguments to get the 200 expected response. `node .\index.js --all`

### Question
---
Shouldn't drive client have the same behavior for all methods?

Setting up `expiry_date` property fix the issue. I'm raising this question because I will expect the same behavior for the other methods, but they work just fine without the mentioned property including `service.files.create()` when used just to create a folder.

Thanks!

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la riproduzione fornita in index.js e confronta service.files.create() con drive.files.list(), sia con sia senza gli argomenti --all, utilizzando le credenziali scadute indicate. Traccia il modo in cui viene gestita l’autenticazione per gli upload multipart rispetto alle altre chiamate; il lavoro è completo quando il comportamento è spiegato e il client gestisce in modo coerente questi stati equivalenti delle credenziali.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
nodejs, typescript
Ambito
api, authentication
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.