<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Frustrating SpotifyOauthError: Invalid Client in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518584#M8272</link>
    <description>&lt;P&gt;Have you added the redirect URI to the dashboard of your app (and clicked save)?&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 11:19:18 GMT</pubDate>
    <dc:creator>Ximzend</dc:creator>
    <dc:date>2023-03-10T11:19:18Z</dc:date>
    <item>
      <title>Frustrating SpotifyOauthError: Invalid Client</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518151#M8263</link>
      <description>Hi, I've repeatedly checked the client_id and client_secret values with those displayed on the developer dashboard. The values are identical. I only ever copy and paste.  &lt;BR /&gt;&lt;BR /&gt;clientID = os.environ['client_id']&lt;BR /&gt;clientSecret = os.environ['client_secret']&lt;BR /&gt;&lt;BR /&gt;sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id=clientID,&lt;BR /&gt;                                                   client_secret=clientSecret,&lt;BR /&gt;                                                   redirect_uri="&lt;A href="http://localhost:8888/callback" target="_blank"&gt;http://localhost:8888/callback&lt;/A&gt;",&lt;BR /&gt;                                                   scope="user-library-read"))&lt;BR /&gt;&lt;BR /&gt;    song_name = "Teen Spirit"&lt;BR /&gt;    &lt;BR /&gt;    search_result = sp.search(q=song_name)&lt;BR /&gt;&lt;BR /&gt;Any help you can offer is greatly appreciated. Thanks</description>
      <pubDate>Thu, 09 Mar 2023 20:47:24 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518151#M8263</guid>
      <dc:creator>SnowedInNonsense</dc:creator>
      <dc:date>2023-03-09T20:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Frustrating SpotifyOauthError: Invalid Client</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518584#M8272</link>
      <description>&lt;P&gt;Have you added the redirect URI to the dashboard of your app (and clicked save)?&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 11:19:18 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518584#M8272</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-03-10T11:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Frustrating SpotifyOauthError: Invalid Client</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518657#M8276</link>
      <description>&lt;P&gt;Thanks Ximzend for taking the time to reply. I did but to no avail.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/oauth2.py", line 588, in refresh_access_token&lt;BR /&gt;response.raise_for_status()&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/requests/models.py", line 1021, in raise_for_status&lt;BR /&gt;raise HTTPError(http_error_msg, response=self)&lt;BR /&gt;requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: &lt;A href="https://accounts.spotify.com/api/token" target="_blank"&gt;https://accounts.spotify.com/api/token&lt;/A&gt;&lt;/P&gt;&lt;P&gt;During handling of the above exception, another exception occurred:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/main.py", line 100, in &amp;lt;module&amp;gt;&lt;BR /&gt;getSpotifyData()&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/main.py", line 65, in getSpotifyData&lt;BR /&gt;search_result = sp.search(q=song_name)&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/client.py", line 585, in search&lt;BR /&gt;return self._get(&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/client.py", line 321, in _get&lt;BR /&gt;return self._internal_call("GET", url, payload, kwargs)&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/client.py", line 245, in _internal_call&lt;BR /&gt;headers = self._auth_headers()&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/client.py", line 236, in _auth_headers&lt;BR /&gt;token = self.auth_manager.get_access_token(as_dict=False)&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/oauth2.py", line 525, in get_access_token&lt;BR /&gt;token_info = self.validate_token(self.cache_handler.get_cached_token())&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/oauth2.py", line 380, in validate_token&lt;BR /&gt;token_info = self.refresh_access_token(&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/oauth2.py", line 596, in refresh_access_token&lt;BR /&gt;self._handle_oauth_error(http_error)&lt;BR /&gt;File "/Users/namofuser/PycharmProjects/pythonProject/pythonProject/spotifyProject/venv/lib/python3.10/site-packages/spotipy/oauth2.py", line 146, in _handle_oauth_error&lt;BR /&gt;raise SpotifyOauthError(&lt;BR /&gt;spotipy.oauth2.SpotifyOauthError: error: invalid_client, error_description: Invalid client&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 14:12:21 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518657#M8276</guid>
      <dc:creator>SnowedInNonsense</dc:creator>
      <dc:date>2023-03-10T14:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Frustrating SpotifyOauthError: Invalid Client</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518779#M8277</link>
      <description>&lt;P&gt;Have you tried deleting the .cache file in the directory you are running your script from?&lt;/P&gt;&lt;P&gt;Also, if you set/name the environment variables as followed, you don't have to specify them in your code anymore:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;SPOTIPY_CLIENT_ID&lt;/LI&gt;&lt;LI&gt;SPOTIPY_CLIENT_SECRET&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;SPOTIPY_REDIRECT_URI&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;Then you can just use:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=SCOPE))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: there shouldn't be quotes around the IDs and URI around the values of the environment variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 18:38:02 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5518779#M8277</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-03-10T18:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: Frustrating SpotifyOauthError: Invalid Client</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5519158#M8287</link>
      <description>&lt;P&gt;Thanks for this. I've cleared the pycharm and browser caches but the error message remains.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Mar 2023 16:24:54 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Frustrating-SpotifyOauthError-Invalid-Client/m-p/5519158#M8287</guid>
      <dc:creator>SnowedInNonsense</dc:creator>
      <dc:date>2023-03-11T16:24:54Z</dc:date>
    </item>
  </channel>
</rss>

