| . |
| P1 | P2 |
Links
|
End
|
mapa
|
Fem :
Perquè python es pugui autenticar sense que hagi d'obrir cap finestra del navegador, cal crear credencials de Service Account
Aquest és el pas que sovint es passa per alt i provoca errors de permisos:
Si quan anem a escriure en una GSS des python i ens surt ...
Explicacio de Google :
Solucio de Gemini :
That error happens because your Google Cloud project's OAuth consent screen is currently set to Testing mode, and the Google account you are trying to sign in with isn't listed as an approved tester.
Since this is a personal or internal script, you do not need to go through Google's formal app verification process. You just need to whitelist your email address in the Google Cloud Console:
Once saved, run your script again. You will still see a warning screen saying "Google hasn't verified this app", which is completely normal for apps in Testing mode — just click Continue (or Advanced - Go to un mes de EFV a GSS (unsafe)) to grant access.
Alternative (Recommended for automated scripts):
If you are the only one using this script and don't want to deal with browser logins or expiring OAuth tokens, switch to a Service Account instead.
You create a service account in Google Cloud, download its JSON key, and simply share your Google Sheet with the service account's @...iam.gserviceaccount.com email address just like you would with a colleague.
That error occurs because the Google Cloud OAuth consent screen User Type is set to Internal rather than External. When set to Internal, Google only allows email addresses belonging to your specific Google Workspace organization domain (for example, @yourdomain.com) and automatically blocks standard @gmail.com accounts from being added as test users.
Solucio :
To allow your @gmail.com address, switch the audience type to External:
|
|
|
|
Updated 20261116 (a)
|
|