invalid_grant
Google akzeptiert die gespeicherte Anmeldung nicht mehr: Ihr Refresh-Token ist abgelaufen, widerrufen oder ersetzt. Melde dich mit Neu verbinden wieder an; passiert das alle 7 Tage, ist dein Google-Projekt noch im Testmodus.
Was der Fehler bedeutet
Google meldet invalid_grant, wenn das Token zum Erneuern des Zugriffs abgelaufen oder ungültig geworden ist. Googles Rat: neu anmelden und erneut zustimmen lassen, um neue Tokens zu bekommen.[1] Direkt nach einer Anmeldung bedeutet derselbe Code, dass der Autorisierungscode ungültig war. Dann hilft es, die Anmeldung neu zu starten.[2]
Häufige Ursachen
- Dein Google-Projekt ist External und im Status Testing. Seine Refresh-Tokens laufen nach 7 Tagen ab.[3][4]
- Du hast den Zugriff der App in deinem Google-Konto entfernt.[5]
- Das Token wurde sechs Monate lang nicht benutzt.[6]
- Für dasselbe Google-Konto und denselben Client gibt es mehr als 100 Refresh-Tokens. Google verwirft dann ohne Warnung das älteste.[7]
- Eine Google-Workspace-Administration hat einen angefragten Dienst auf Restricted gestellt. Das zeigt sich als
admin_policy_enforced.[8] - Das Google-Konto wurde gelöscht oder deaktiviert.[1]
So behebst du ihn
- Publit.Si → Konten → YouTube-Konto öffnen → Neu verbinden. Trenne das Konto nicht vorher: Das bricht geplante Beiträge ab.[9]
- Melde dich mit demselben Google-Konto an und setze im Berechtigungsdialog von Google den Haken bei Select all.[9]
- Prüfe Google Auth Platform → Audience → Publishing status. Testing heißt: alle 7 Tage neu anmelden.[4]
- Ohne wöchentliche Neuanmeldung: Stell das Projekt auf In production um (braucht Branding auf deiner eigenen Domain) und verbinde einmal neu.[9][10]
- Für den eigenen Gebrauch mit weniger als 100 Nutzern verlangt Google dafür keine Prüfung.[11]
So geht Publit.Si damit um
Publit.Si erneuert das kurzlebige Zugriffstoken selbst, solange Googles Anmeldung dahinter gilt. Im Testmodus endet diese Anmeldung trotzdem nach 7 Tagen, und Publit.Si erinnert dich ans Neuverbinden.[9] Publit.Si sieht am Token nicht, ob dein Projekt im Status Testing oder In production ist. Das zeigt Google Auth Platform → Audience → Publishing status.[9]
Fragen
Warum fällt YouTube jede Woche aus?
Dein Google-Projekt ist External und im Status Testing, und Google lässt seine Refresh-Tokens nach 7 Tagen ablaufen. Stell das Projekt einmal auf In production um und verbinde neu.
Löscht neu verbinden meine geplanten Beiträge?
Nein. Neu verbinden behält sie. Trennen bricht geplante Beiträge ab, nutze also immer Neu verbinden.
Muss Google den Produktionsmodus prüfen?
Nicht für den eigenen Gebrauch mit weniger als 100 Nutzern. Die Warnung zur ungeprüften App bleibt, du kannst sie aber wegklicken.
Passend dazu
Quellen
- [1] Google: OAuth 2.0 for Web Server Applications: https://developers.google.com/identity/protocols/oauth2/web-server, geprüft am 17. November 2026
„When refreshing an access token or using incremental authorization, the token may have expired or has been invalidated. Authenticate the user again and ask for user consent to obtain new tokens. If you are continuing to see this error, ensure that your application has been configured correctly and that you are using the correct tokens and parameters in your request. Otherwise, the user account may have been deleted or disabled.“
- [2] Google: OAuth 2.0 for Web Server Applications: https://developers.google.com/identity/protocols/oauth2/web-server, geprüft am 17. November 2026
„The supplied authorization code is invalid or in the wrong format. Request a new code by restarting the OAuth process to prompt the user for consent again.“
- [3] Google: Using OAuth 2.0 to Access Google APIs: https://developers.google.com/identity/protocols/oauth2, geprüft am 17. November 2026
„A Google Cloud Platform project with an OAuth consent screen configured for an external user type and a publishing status of "Testing" is issued a refresh token expiring in 7 days, unless the only OAuth scopes requested are a subset of name, email address, and user profile (through the userinfo.email, userinfo.profile, openid scopes, or their OpenID Connect equivalents).“
- [4] Google Cloud Help: Manage App Audience: https://support.google.com/cloud/answer/15549945?hl=en, geprüft am 17. November 2026
„Authorizations by a test user will expire seven days from the time of consent. If your OAuth client requests an offline access type and receives a refresh token, that token will also expire.“
- [5] Google: Using OAuth 2.0 to Access Google APIs: https://developers.google.com/identity/protocols/oauth2, geprüft am 17. November 2026
„The user has revoked your app's access.“
- [6] Google: Using OAuth 2.0 to Access Google APIs: https://developers.google.com/identity/protocols/oauth2, geprüft am 17. November 2026
„The refresh token has not been used for six months.“
- [7] Google: Using OAuth 2.0 to Access Google APIs: https://developers.google.com/identity/protocols/oauth2, geprüft am 17. November 2026
„There is currently a limit of 100 refresh tokens per Google Account per OAuth 2.0 client ID. If the limit is reached, creating a new refresh token automatically invalidates the oldest refresh token without warning.“
- [8] Google: Using OAuth 2.0 to Access Google APIs: https://developers.google.com/identity/protocols/oauth2, geprüft am 17. November 2026
„If an admin set any of the services requested in your app's scopes to Restricted (the error is admin_policy_enforced).“
- [9] Publit.Si-Doku: YouTube verbinden: publit.si/de/docs/platforms/youtube
- [10] Google Cloud Help: Manage App Audience: https://support.google.com/cloud/answer/15549945?hl=en, geprüft am 17. November 2026
„Projects configured with a publishing status of In production are available to any user with a Google Account. A project's publishing status is considered In production after selecting the Publish app button.“
- [11] Google Cloud Help: When is verification not needed: https://support.google.com/cloud/answer/13464323?hl=en, geprüft am 17. November 2026
„Personal Use apps: If the app is for your personal use (fewer than 100 users), you and your limited number of users can continue using the app without going through verification(users will be allowed to click through “unverified app” warning screens during sign-in).“