title: Spotify API scopes not being recognized - not able to access user info
body: <p>I am currently implementing a feature that you have the ability to save a song displayed on my iOS application (written with Swift) and this save button allows the song to be appended to the user's Spotify library. According to the Spotify Developer guide, the only scope required for this feature is <code>user-library-modify</code> when authorizing the app with the user. The url to be opened goes like this:</p>
  
  <p><a href="https://accounts.spotify.com/authorize/?client_id=my_client_id&amp;response_type=code&amp;scope=user-library-modify&amp;redirect_uri=http://my_redirect_uri" rel="nofollow noreferrer">https://accounts.spotify.com/authorize/?client_id=my_client_id&amp;response_type=code&amp;scope=user-library-modify&amp;redirect_uri=http://my_redirect_uri</a></p>
  
  <p>This all works perfectly - the url is opened for the user to approve of the changes my app can make and the callback url with the required code is in the url is opened. </p>
  
  <p>The next step in performing the required function is to get an exact token in order to use the api, which is done by calling the url:</p>
  
  <p><a href="https://accounts.spotify.com/api/token?grant_type=client_credentials&amp;client_id=my_client_id&amp;client_secret=my_client_secret&amp;response_type=code&amp;redirect_uri=http://my_redirect_uri&amp;code=the_code_I_just_retrieved" rel="nofollow noreferrer">https://accounts.spotify.com/api/token?grant_type=client_credentials&amp;client_id=my_client_id&amp;client_secret=my_client_secret&amp;response_type=code&amp;redirect_uri=http://my_redirect_uri&amp;code=the_code_I_just_retrieved</a></p>
  
  <p>With this url, a json file is returned with the new token and info with it, BUT when looking at the permitted scopes the token has, it is empty:</p>
  
  <p><code>["scope": , "token_type": Bearer, "access_token": the_token_string, "expires_in": 3600]</code></p>
  
  <p>Also, when I still try to perform the request it returns:</p>
  
  <p><code>["error": {
      message = "Insufficient client scope";
      status = 403;
  }]</code></p>
  
  <p>In this lengthy process, what am I doing wrong? In case you are wondering, here are a few things I have tried without success:</p>
  
  <p>1) Re-listing the scopes in the explicit token request</p>
  
  <p>2)Adding utf-8 encoding to the redirect uri (not sure if this changes anything)</p>
  
  <p>3)Adding many other scopes (although this clearly does not target the problem)</p>
  
  <p>If anyone knows what I am doing wrong or has any suggestions as to what I should try, I am grateful for any helpful response!</p>