<?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: Wrong token generated in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5523027#M8405</link>
    <description>&lt;P&gt;&lt;SPAN&gt;You'll need to make a webpage that implements the Authorization code flow (&lt;A href="https://github.com/thelinmichael/spotify-web-api-node#authorization-code-flow" target="_blank" rel="noopener"&gt;shown here&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;) that lets you log in with your credentials, and prints out an access token and a refresh token. The required scope is &lt;STRONG&gt;user-modify-playback-state&lt;/STRONG&gt;. (If everything works, you can remove this page.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can store the access token and the refresh token in a file or database on your server. After that, you can make a client side page with volume controls that sends requests to a server-side script that uses those tokens to make a API request to control the volume. (Maybe there is more code required than I described.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am not familiar with the Node.js wrapper, but it must ve documented what it does or you should do when the access token expires.&lt;/P&gt;&lt;P&gt;If you get a new access token and/or refresh token, those should replace the old ones stored on your server. (If you don't get a new refresh token, you can reuse the old one.)&lt;/P&gt;</description>
    <pubDate>Sat, 18 Mar 2023 11:42:12 GMT</pubDate>
    <dc:creator>Ximzend</dc:creator>
    <dc:date>2023-03-18T11:42:12Z</dc:date>
    <item>
      <title>Wrong token generated</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522700#M8393</link>
      <description>&lt;P&gt;Hello I have a problem setting up a simple aplication.&lt;BR /&gt;The goal of this application is to enable anyone who has an url to my web app to adjust volume of my music playing ( mainly for neighbors , but the project goal is to educate mysef in spotify API and Nuxt.js ).&lt;BR /&gt;&lt;BR /&gt;Im using 3 methods:&lt;BR /&gt;1. Getting the token using client_id and client_secret.&lt;BR /&gt;2. Getting devices to pre-fill input with current volume.&lt;BR /&gt;3. Sending a request to set new volume based on the input.&lt;BR /&gt;&lt;BR /&gt;methods 2 and 3 work as intended if i hardcode tokens that i get from live test&lt;BR /&gt;for example : &lt;A href="https://developer.spotify.com/console/get-users-available-devices/" target="_blank"&gt;https://developer.spotify.com/console/get-users-available-devices/&lt;/A&gt; and i use get token button. but the problem is that the first metod return an invalid token ( i get an error that username is invalid, I can't see what am I doing wrong. Client id and secret are generated from my spotify App. I belive that I'm really close to finishing this but I'm stuck at this step&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 18:30:38 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522700#M8393</guid>
      <dc:creator>Laremit</dc:creator>
      <dc:date>2023-03-17T18:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong token generated</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522746#M8395</link>
      <description>&lt;P&gt;Generated access tokens are only valid for 60 minutes. Then you'll need a refresh token to get a new one. You can read more about it &lt;A href="https://developer.spotify.com/documentation/general/guides/authorization/code-flow/" target="_blank" rel="noopener"&gt;on this page&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;To make things a lot easier, I recommend you to use a "&lt;A href="https://developer.spotify.com/documentation/web-api/libraries/#:~:text=reviewed%20by%20Spotify.-,Web%20API%20Wrappers,-.NET" target="_blank" rel="noopener"&gt;Web API Wrapper&lt;/A&gt;".&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2023 19:26:18 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522746#M8395</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-03-17T19:26:18Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong token generated</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522986#M8400</link>
      <description>&lt;P&gt;I will check out that Wrapper for node, It seems a good idea.&lt;BR /&gt;But the token valid time has nothing to do with the problem I have, token are invalid the second they are generated, any idea why is that? I can provide more resources if needed&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 09:26:35 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522986#M8400</guid>
      <dc:creator>Laremit</dc:creator>
      <dc:date>2023-03-18T09:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong token generated</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522996#M8402</link>
      <description>&lt;P&gt;"Since &lt;A href="https://developer.spotify.com/documentation/general/guides/authorization/client-credentials/" target="_blank" rel="noopener nofollow noreferrer"&gt;[the Client Credentials] flow&lt;/A&gt; does not include authorization, only endpoints that do not access user information can be accessed."&lt;BR /&gt;That could be a problem.&lt;BR /&gt;Does endpoint&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;A href="https://api.spotify.com/v1/me/player/devices" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/me/player/devices&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;can be accessed with that ? (&lt;BR /&gt;&lt;BR /&gt;If not, what other authorization method do you recommend for my case?&lt;BR /&gt;I will once more describe the user story of that:&lt;BR /&gt;AS an app creator I need the app to alter MY player and only my player,&lt;BR /&gt;AS an end user I need to have access without any logging in required, and be able to read current playback volume and set new one using input type="range".&lt;BR /&gt;&lt;BR /&gt;All other Auth methods include a logging in by end user step that I don,t want since only my player needs to be affected.&lt;BR /&gt;So long story short, this app needs to allow every person on planet earth with a link to that app to alter MY volume XD&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 09:47:52 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5522996#M8402</guid>
      <dc:creator>Laremit</dc:creator>
      <dc:date>2023-03-18T09:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong token generated</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5523027#M8405</link>
      <description>&lt;P&gt;&lt;SPAN&gt;You'll need to make a webpage that implements the Authorization code flow (&lt;A href="https://github.com/thelinmichael/spotify-web-api-node#authorization-code-flow" target="_blank" rel="noopener"&gt;shown here&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;) that lets you log in with your credentials, and prints out an access token and a refresh token. The required scope is &lt;STRONG&gt;user-modify-playback-state&lt;/STRONG&gt;. (If everything works, you can remove this page.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You can store the access token and the refresh token in a file or database on your server. After that, you can make a client side page with volume controls that sends requests to a server-side script that uses those tokens to make a API request to control the volume. (Maybe there is more code required than I described.)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I am not familiar with the Node.js wrapper, but it must ve documented what it does or you should do when the access token expires.&lt;/P&gt;&lt;P&gt;If you get a new access token and/or refresh token, those should replace the old ones stored on your server. (If you don't get a new refresh token, you can reuse the old one.)&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 11:42:12 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5523027#M8405</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-03-18T11:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Wrong token generated</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5523054#M8406</link>
      <description>&lt;P&gt;Thats a great suggestion and that is the approach I will take. Thank you so much for your insight in this, have a great day&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 12:05:36 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Wrong-token-generated/m-p/5523054#M8406</guid>
      <dc:creator>Laremit</dc:creator>
      <dc:date>2023-03-18T12:05:36Z</dc:date>
    </item>
  </channel>
</rss>

