Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Extension: Google Photos API Returns "Insufficient Scopes" Despite Correct Setup

I’m building a Chrome extension that integrates with Google Photos API, but I keep hitting a 403 PERMISSION_DENIED error with the message: "Request had insufficient authentication scopes"

What Works

  • Google Calendar API requests succeed with the same auth flow (calendar.readonly scope works perfectly).
  • The OAuth token is obtained successfully.
  • The extension has the correct scopes declared in manifest.json.

What I’ve Tried

Manifest.json Configuration:

"scopes": [
    "https://www.googleapis.com/auth/calendar.readonly",
    "https://www.googleapis.com/auth/photoslibrary.readonly",
    "https://www.googleapis.com/auth/photoslibrary"
  ]
  1. Enabled Google Photos Library API in Google Cloud Console.
  2. Added Test Users to OAuth consent screen (app is in "Testing" mode).

API Endpoints Tested:

  1. https://photoslibrary.googleapis.com/v1/mediaItems

  2. https://photoslibrary.googleapis.com/v1/mediaItems:search

Screenshots:

The scopes added

The 403 error

Why does the same token work for Calendar API but fail for Photos API?

Why does the Photos API claim "insufficient scopes" when the token includes them?

Has anyone successfully used Google Photos API in a Chrome extension? Are there hidden requirements or quota limits I’m missing?

like image 611
ss511 Avatar asked Dec 07 '25 03:12

ss511


1 Answers

the scope photoslibrary.readonlyphotoslibrary has been deprecated and will be removed after March 31, 2025.

After this date, any API calls using only this scope will return a 403 PERMISSION_DENIED error.

What should you do?

For reading photos, use the https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata scope.

For other use cases, review the latest Google Photos API documentation for supported scopes and migration instructions.

Reference:

https://developers.google.com/photos/support/updates#affected-scopes-methods

like image 57
CCLU Avatar answered Dec 08 '25 22:12

CCLU



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!