<?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: Serverless personal project - refreshing auth token solution in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5375710#M4499</link>
    <description>&lt;P&gt;Sorry for piggy backing on this post, do refresh tokens have an expiration? Can't seem to find it anywhere in the docs.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Apr 2022 21:14:48 GMT</pubDate>
    <dc:creator>risaac86</dc:creator>
    <dc:date>2022-04-29T21:14:48Z</dc:date>
    <item>
      <title>Serverless personal project - refreshing auth token solution</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248129#M3097</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Premium&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;UK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Question or Issue&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am developing a very simple jukebox style app for purely personal use to control my queue and allow others to add songs to it at parties and gathering etc. It will only ever use or need permission to access my own spotify account.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That being said, the docs on auth method seems needlessly overkill and convoluted for my use case. This is a simple locally hosted web page that invokes the api with ajax and client side javascript. I will not be hosting this on the web or making requiring a server/backend. I just want to either not have to refresh a token every hour (unrealistic) or, if I must, have a simple way of doing so via checking if the one I have is expired and getting a new one, or using the one I have. The 4 documented methods all fail to meet my use case, and all for some reason assume I have server based and require a redirect_uri as a parameter. I am lost as to how to proceed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please any advice would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;</description>
      <pubDate>Sat, 14 Aug 2021 14:48:20 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248129#M3097</guid>
      <dc:creator>Icikle</dc:creator>
      <dc:date>2021-08-14T14:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Serverless personal project - refreshing auth token solution</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248258#M3099</link>
      <description>&lt;P&gt;Even though the authorization methods require a redirect uri, the url that you choose for this doesn't need to actually work. For example, you could set the redirect uri to "&lt;A href="http://localhost&amp;quot;" target="_blank"&gt;http://localhost"&lt;/A&gt;. After being redirected to this URL, just copy the authorization code from the query string manually and proceed with the rest of the authorization process.&amp;nbsp;&lt;STRONG&gt;You only need to do this process once&lt;/STRONG&gt;&lt;STRONG&gt;.&lt;/STRONG&gt; Refreshing the access token when it is expired is a very simple process that you can easily automate. Spotify tells you when the access token will expire, so, before each api request, check if it is expired and refresh it if necessary. There's nothing complicated about that. There are plenty of libraries that can do this for you.&lt;/P&gt;</description>
      <pubDate>Sat, 14 Aug 2021 22:54:49 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248258#M3099</guid>
      <dc:creator>Peter_Schorn</dc:creator>
      <dc:date>2021-08-14T22:54:49Z</dc:date>
    </item>
    <item>
      <title>Re: Serverless personal project - refreshing auth token solution</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248364#M3100</link>
      <description>What if not redirecting to my locally hosted index.html breaks my app flow?</description>
      <pubDate>Sun, 15 Aug 2021 08:11:01 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248364#M3100</guid>
      <dc:creator>Icikle</dc:creator>
      <dc:date>2021-08-15T08:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Serverless personal project - refreshing auth token solution</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248481#M3101</link>
      <description>&lt;P&gt;I don't know what your "app flow" is, so I don't know how to answer your question. Try asking a more specific question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The authorization methods are what they are, and there's no way to authorize your app other that what the docs describe. Accept that fact.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See&amp;nbsp;&lt;A href="https://developer.spotify.com/documentation/web-api/libraries/" target="_blank"&gt;https://developer.spotify.com/documentation/web-api/libraries/&lt;/A&gt;&amp;nbsp;for a list of libraries that can implement the authorization process for you.&lt;/P&gt;</description>
      <pubDate>Sun, 15 Aug 2021 16:25:44 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5248481#M3101</guid>
      <dc:creator>Peter_Schorn</dc:creator>
      <dc:date>2021-08-15T16:25:44Z</dc:date>
    </item>
    <item>
      <title>Re: Serverless personal project - refreshing auth token solution</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5375710#M4499</link>
      <description>&lt;P&gt;Sorry for piggy backing on this post, do refresh tokens have an expiration? Can't seem to find it anywhere in the docs.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Apr 2022 21:14:48 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5375710#M4499</guid>
      <dc:creator>risaac86</dc:creator>
      <dc:date>2022-04-29T21:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Serverless personal project - refreshing auth token solution</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5376023#M4503</link>
      <description>&lt;P class=""&gt;The refresh token never expires.&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;For the authorization code flow, you use the same refresh token each time to refresh the access token.&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;For the authorization code flow with PKCE, the refresh token can only be used to retrieve a new access token and refresh token once, after which the previous refresh token becomes invalid. So, make sure to save the newly returned refresh token.&lt;/P&gt;</description>
      <pubDate>Sat, 30 Apr 2022 17:52:04 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Serverless-personal-project-refreshing-auth-token-solution/m-p/5376023#M4503</guid>
      <dc:creator>Peter_Schorn</dc:creator>
      <dc:date>2022-04-30T17:52:04Z</dc:date>
    </item>
  </channel>
</rss>

