Skip to content

Spotify Login Error 400 - SOLVED - deleted the cache file #2

Description

@matteool

hi, i'm running frontend and backend server, i configured everything and logged in YT from the local page, but it doesnt work with spotify.
after the spotify login the app doesnt say "connected" and the "connect to spotify" button remains.

in the backend terminal i have this:

`127.0.0.1 - - [24/Dec/2025 15:18:55] "GET /auth/spotify HTTP/1.1" 302 -
Traceback (most recent call last):
File "C:\Users\Claudia\miniforge3\Lib\site-packages\spotipy\oauth2.py", line 578, in refresh_access_token
response.raise_for_status()
File "C:\Users\Claudia\miniforge3\Lib\site-packages\requests\models.py", line 1024, 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 "C:\Users\Claudia\Spotify-to-Youtube-Music\backend\main.py", line 96, in spotify_callback
token_info = sp_oauth.get_access_token(code)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Claudia\miniforge3\Lib\site-packages\spotipy\oauth2.py", line 515, in get_access_token
token_info = self.validate_token(self.cache_handler.get_cached_token())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Claudia\miniforge3\Lib\site-packages\spotipy\oauth2.py", line 371, in validate_token
token_info = self.refresh_access_token(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Claudia\miniforge3\Lib\site-packages\spotipy\oauth2.py", line 586, in refresh_access_token
self._handle_oauth_error(http_error)
File "C:\Users\Claudia\miniforge3\Lib\site-packages\spotipy\oauth2.py", line 139, in _handle_oauth_error
raise SpotifyOauthError(
spotipy.oauth2.SpotifyOauthError: error: invalid_client, error_description: Invalid client`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions