Plan
Premium Family
Country
Canada
Device
Raspberry Pi 3B+
Operating System
Raspbian 11
My Question or Issue
I've created an app in the Developer Dashboard for a device I've created that uses a raspberry pi. However, when I try to authenticate the client/device, I get the following error:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/spotipy/oauth2.py", line 588, in refresh_access_token
response.raise_for_status()
File "/usr/lib/python3/dist-packages/requests/models.py", line 943, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://accounts.spotify.com/api/token
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/Desktop/QPTestScripts/getDevices.py", line 12, in <module>
devices = sp.devices()
File "/usr/local/lib/python3.9/dist-packages/spotipy/client.py", line 1748, in devices
return self._get("me/player/devices")
File "/usr/local/lib/python3.9/dist-packages/spotipy/client.py", line 323, in _get
return self._internal_call("GET", url, payload, kwargs)
File "/usr/local/lib/python3.9/dist-packages/spotipy/client.py", line 247, in _internal_call
headers = self._auth_headers()
File "/usr/local/lib/python3.9/dist-packages/spotipy/client.py", line 238, in _auth_headers
token = self.auth_manager.get_access_token(as_dict=False)
File "/usr/local/lib/python3.9/dist-packages/spotipy/oauth2.py", line 525, in get_access_token
token_info = self.validate_token(self.cache_handler.get_cached_token())
File "/usr/local/lib/python3.9/dist-packages/spotipy/oauth2.py", line 380, in validate_token
token_info = self.refresh_access_token(
File "/usr/local/lib/python3.9/dist-packages/spotipy/oauth2.py", line 596, in refresh_access_token
self._handle_oauth_error(http_error)
File "/usr/local/lib/python3.9/dist-packages/spotipy/oauth2.py", line 146, in _handle_oauth_error
raise SpotifyOauthError(
spotipy.oauth2.SpotifyOauthError: error: invalid_client, error_description: Invalid client
I've verified that the client ID, client secret, and redirect URI match what is in the app in the developer dashboard, and I've also checked that the scopes are correct. How can I resolve this issue? Your help is much appreciated!