<?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 Insufficient Client Scope after Refresh Token in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526728#M8468</link>
    <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to build an embedded application that will simply add the current song playing to a specified playlist [playlist_id]. The issue that I'm running in is that when I follow the guide on generating Authentication tokens, I'm getting "Insufficient Client Scope" error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use:&amp;nbsp;&lt;BR /&gt;&lt;A class="" title="https://accounts.spotify.com/authorize?client_id=20aacf6bdca34cd88205370dbd189875&amp;amp;scopes=playlist-read-private%20playlist-read-collaborative%20playlist-modify-private%20playlist-modify-public&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080" href="https://accounts.spotify.com/authorize?client_id=20aacf6bdca34cd88205370dbd189875&amp;amp;scopes=playlist-read-private%20playlist-read-collaborative%20playlist-modify-private%20playlist-modify-public&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080" target="_blank" rel="noreferrer noopener"&gt;https://accounts.spotify.com/authorize?client_id=&amp;lt;my_client_id&amp;gt;&amp;amp;scopes=playlist-read-private%20playlist-read-collaborative%20playlist-modify-private%20playlist-modify-public%20user-read-curently-playing&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;URL to generate an access token that will work for the given scopes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I get to the Auth page and authorize the app, I obtain the Auth token for the next step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After getting the token, I run:&lt;BR /&gt;curl -H "Authorization: Basic &amp;lt;base64(client_id:client_secret)&amp;gt;" -d grant_type=authorization_code -d code=&amp;lt;auth_token&amp;gt; -d redirect_uri=http%3A%2F%2Flocalhost%3A8080 &lt;A class="" title="https://accounts.spotify.com/api/token" href="https://accounts.spotify.com/api/token" target="_blank" rel="noreferrer noopener"&gt;https://accounts.spotify.com/api/token&lt;/A&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command in order to get the JSON containing `access_token`, `token_type`, `expires_in` and `refresh_token`.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issue comes when I try to use the endpoints for adding songs to the playlist and I try to pass it either the `access_token` generated in this response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or the `access_token` generated by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;grant_type=refresh_token&amp;amp;refresh_token=&amp;lt;refresh_token&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I keep getting the same error.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All the while, if I use the token builder on Spotify's website, it will work as it should, for an hour, until it expires.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any idea why my tokens aren't generated correctly? For a reference, tokens that I get in the JSON response are about 173 characters long whereas the one that is generated in Spotify's website is about 240+ characters long.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you in advance for the help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Mar 2023 00:07:13 GMT</pubDate>
    <dc:creator>Falcuun</dc:creator>
    <dc:date>2023-03-24T00:07:13Z</dc:date>
    <item>
      <title>Insufficient Client Scope after Refresh Token</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526728#M8468</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to build an embedded application that will simply add the current song playing to a specified playlist [playlist_id]. The issue that I'm running in is that when I follow the guide on generating Authentication tokens, I'm getting "Insufficient Client Scope" error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I use:&amp;nbsp;&lt;BR /&gt;&lt;A class="" title="https://accounts.spotify.com/authorize?client_id=20aacf6bdca34cd88205370dbd189875&amp;amp;scopes=playlist-read-private%20playlist-read-collaborative%20playlist-modify-private%20playlist-modify-public&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080" href="https://accounts.spotify.com/authorize?client_id=20aacf6bdca34cd88205370dbd189875&amp;amp;scopes=playlist-read-private%20playlist-read-collaborative%20playlist-modify-private%20playlist-modify-public&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080" target="_blank" rel="noreferrer noopener"&gt;https://accounts.spotify.com/authorize?client_id=&amp;lt;my_client_id&amp;gt;&amp;amp;scopes=playlist-read-private%20playlist-read-collaborative%20playlist-modify-private%20playlist-modify-public%20user-read-curently-playing&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;URL to generate an access token that will work for the given scopes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I get to the Auth page and authorize the app, I obtain the Auth token for the next step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After getting the token, I run:&lt;BR /&gt;curl -H "Authorization: Basic &amp;lt;base64(client_id:client_secret)&amp;gt;" -d grant_type=authorization_code -d code=&amp;lt;auth_token&amp;gt; -d redirect_uri=http%3A%2F%2Flocalhost%3A8080 &lt;A class="" title="https://accounts.spotify.com/api/token" href="https://accounts.spotify.com/api/token" target="_blank" rel="noreferrer noopener"&gt;https://accounts.spotify.com/api/token&lt;/A&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Command in order to get the JSON containing `access_token`, `token_type`, `expires_in` and `refresh_token`.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Issue comes when I try to use the endpoints for adding songs to the playlist and I try to pass it either the `access_token` generated in this response.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or the `access_token` generated by running:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;grant_type=refresh_token&amp;amp;refresh_token=&amp;lt;refresh_token&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I keep getting the same error.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;All the while, if I use the token builder on Spotify's website, it will work as it should, for an hour, until it expires.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any idea why my tokens aren't generated correctly? For a reference, tokens that I get in the JSON response are about 173 characters long whereas the one that is generated in Spotify's website is about 240+ characters long.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thank you in advance for the help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 00:07:13 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526728#M8468</guid>
      <dc:creator>Falcuun</dc:creator>
      <dc:date>2023-03-24T00:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Insufficient Client Scope after Refresh Token</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526759#M8469</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Tail-wagging hello to you Falcuun!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The "Insufficient Client Scope" error you are receiving suggests that the access token you are using does not have the necessary permissions to perform the action you are trying to take. In this case, it seems like your access token is missing the necessary scope for adding a song to a playlist.&lt;/P&gt;&lt;P&gt;To add the necessary scope to your access token, you will need to modify the authorization URL to include the playlist-modify-public or playlist-modify-private scope, depending on whether the playlist is public or private.&lt;/P&gt;&lt;P&gt;For example, you could modify the authorization URL to include the playlist-modify-public scope as follows:&lt;/P&gt;&lt;P&gt;&lt;A href="https://accounts.spotify.com/authorize?client_id=" target="_blank" rel="noopener"&gt;https://accounts.spotify.com/authorize?client_id=&lt;/A&gt;&amp;lt;client_id&amp;gt;&amp;amp;response_type=code&amp;amp;redirect_uri=http%3A%2F%2Flocalhost%3A8080&amp;amp;scope=playlist-modify-public&lt;/P&gt;&lt;P&gt;Alternatively, if you are using the Spotify Web API library for your language, you can add the necessary scope when creating the authorization URL:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;sp_oauth = oauth2.SpotifyOAuth(
    client_id=&amp;lt;client_id&amp;gt;,
    client_secret=&amp;lt;client_secret&amp;gt;,
    redirect_uri=&amp;lt;redirect_uri&amp;gt;,
    scope='playlist-modify-public'
)
auth_url = sp_oauth.get_authorize_url()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once you have authorized the app with the necessary scope and obtained an access token, you should be able to use it to add a song to a playlist.&lt;/P&gt;&lt;P&gt;If you continue to experience issues with generating valid access tokens, you may want to double-check that your client ID and client secret are correct and that you are using the correct authorization flow for your use case. Additionally, it may be helpful to review the Spotify API documentation and see if there are any specific requirements or limitations that apply to your use case.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My ears are perked up and waiting for updates!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-Prague the Dog&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 01:09:42 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526759#M8469</guid>
      <dc:creator>Prague</dc:creator>
      <dc:date>2023-03-24T01:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Insufficient Client Scope after Refresh Token</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526787#M8470</link>
      <description>&lt;P&gt;Good Boy, Prague!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;That worked. I think what the main issue was, was the order of parameters in the URL. Moving `scopes` to the end of the URL actually requests the scopes to be added. Seems my issue was way simple than what I was making it out to be.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for the help!&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":meat_on_bone:"&gt;🍖&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 01:42:38 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5526787#M8470</guid>
      <dc:creator>Falcuun</dc:creator>
      <dc:date>2023-03-24T01:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Insufficient Client Scope after Refresh Token</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5847296#M12486</link>
      <description>&lt;P&gt;Hi, I am trying to do something similar but using the scope for&amp;nbsp;&lt;SPAN class=""&gt;user-read-recently-played. Is there any way I can add this scope manually through the dashboard or do I need to follow the same process? I did what was above and got a code from the URL. Where would I use that? Also, I want to make an application that can generate refresh tokens on its own so this can be a one-time process. Any help would be greatly appreciated.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 14:18:24 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Insufficient-Client-Scope-after-Refresh-Token/m-p/5847296#M12486</guid>
      <dc:creator>martinweiss</dc:creator>
      <dc:date>2024-01-29T14:18:24Z</dc:date>
    </item>
  </channel>
</rss>

