Skip to content

Fix invalid scope error when adding a custom Spotify client ID#4182

Merged
marcelveldt merged 1 commit into
devfrom
fix-spotify-invalid-scope
Jun 12, 2026
Merged

Fix invalid scope error when adding a custom Spotify client ID#4182
marcelveldt merged 1 commit into
devfrom
fix-spotify-invalid-scope

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

What does this implement/fix?

Adding a custom Spotify client ID (developer token) fails during authorization with an invalid scope error. The requested OAuth scope list contained three strings that are not valid Spotify scopes: playlist-read, user-modify-private and user-modify. Spotify historically ignored unknown scopes, so this went unnoticed — but newly created Development Mode client IDs (Feb 2026 platform changes) now strictly validate scopes and reject the whole authorization request. Music Assistant's built-in client ID is unaffected, which is why only users supplying their own (recently created) client ID hit this.

No functionality is lost — the valid scopes covering the same access (playlist-read-private, playlist-read-collaborative, user-modify-playback-state) were already being requested.

Changes:

  • Remove the invalid scopes playlist-read, user-modify-private and user-modify from the Spotify OAuth scope list.

Types of changes

  • Bugfix (non-breaking change which fixes an issue) — bugfix
  • New feature (non-breaking change which adds functionality) — new-feature
  • Enhancement to an existing feature — enhancement
  • New music/player/metadata/plugin provider — new-provider
  • Breaking change (fix or feature that would cause existing functionality to not work as expected) — breaking-change
  • Refactor (no behaviour change) — refactor
  • Documentation only — documentation
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • pytest passes, and tests have been added/updated under tests/ where applicable.
  • For changes to shared models, the companion PR in music-assistant/models is linked.
  • For changes affecting the UI, the companion PR in music-assistant/frontend is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate.

The OAuth scope list contained three strings that are not valid Spotify
scopes: playlist-read, user-modify-private and user-modify. Spotify
historically ignored unknown scopes, but newly created Development Mode
client IDs now strictly validate them and reject the whole authorization
request with an invalid scope error.

Remove the invalid scopes; the valid scopes covering the same access
(playlist-read-private, playlist-read-collaborative,
user-modify-playback-state) were already being requested, so no
functionality is lost.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Spotify OAuth authorization failures for users supplying a custom (Feb 2026 “Development Mode”) Spotify client ID by removing invalid/unsupported scope strings from the requested scope list, preventing Spotify from rejecting the entire auth request with invalid scope.

Changes:

  • Remove invalid Spotify OAuth scopes (playlist-read, user-modify-private, user-modify) from the provider’s SCOPE constant.

@marcelveldt marcelveldt merged commit a82050c into dev Jun 12, 2026
14 checks passed
@marcelveldt marcelveldt deleted the fix-spotify-invalid-scope branch June 12, 2026 06:45
anatosun pushed a commit to anatosun/music-assistant-server that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants