<?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 Authorization Code Flow Automation in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Authorization-Code-Flow-Automation/m-p/5377190#M4515</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;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Lenovo Laptop&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Windows&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;I am working on a program that can play/pause/skip songs etc.&lt;/P&gt;&lt;P&gt;I first tried using the Client Credentials Flow, but got this error:&lt;/P&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;&lt;LI-CODE lang="javascript"&gt;{
  "error": {
    "status": 403,
    "message": "Player command failed: Premium required",
    "reason": "PREMIUM_REQUIRED"
  }
}&lt;/LI-CODE&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;&lt;P&gt;Using this forum, I found out that you cannot interact with the&amp;nbsp;&lt;STRONG&gt;v1/me/player&lt;/STRONG&gt; endpoint using the access token from Client Credentials and you have to use the access token gained from the Authorization Code Flow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the template given from the Web API Tutorial and it was functioning and would give me a valid access token that can interact with the &lt;STRONG&gt;v1/me/player&lt;/STRONG&gt; endpoint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it is a very manual process to get the token(have to create a HTML page and log in to authorize), whereas with the Client Credentials, you could get the token just through some code and no manual input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there was a way to automate the&amp;nbsp;Authorization Code Flow to get the access token so that I can then play/pause music etc. all through my program without any manual authorization?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 12:12:03 GMT</pubDate>
    <dc:creator>hobanator123</dc:creator>
    <dc:date>2022-05-03T12:12:03Z</dc:date>
    <item>
      <title>Authorization Code Flow Automation</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Authorization-Code-Flow-Automation/m-p/5377190#M4515</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;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Lenovo Laptop&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Windows&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;I am working on a program that can play/pause/skip songs etc.&lt;/P&gt;&lt;P&gt;I first tried using the Client Credentials Flow, but got this error:&lt;/P&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;&lt;LI-CODE lang="javascript"&gt;{
  "error": {
    "status": 403,
    "message": "Player command failed: Premium required",
    "reason": "PREMIUM_REQUIRED"
  }
}&lt;/LI-CODE&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;&lt;P&gt;Using this forum, I found out that you cannot interact with the&amp;nbsp;&lt;STRONG&gt;v1/me/player&lt;/STRONG&gt; endpoint using the access token from Client Credentials and you have to use the access token gained from the Authorization Code Flow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the template given from the Web API Tutorial and it was functioning and would give me a valid access token that can interact with the &lt;STRONG&gt;v1/me/player&lt;/STRONG&gt; endpoint.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it is a very manual process to get the token(have to create a HTML page and log in to authorize), whereas with the Client Credentials, you could get the token just through some code and no manual input.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering if there was a way to automate the&amp;nbsp;Authorization Code Flow to get the access token so that I can then play/pause music etc. all through my program without any manual authorization?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Ryan&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 12:12:03 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Authorization-Code-Flow-Automation/m-p/5377190#M4515</guid>
      <dc:creator>hobanator123</dc:creator>
      <dc:date>2022-05-03T12:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: Authorization Code Flow Automation</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Authorization-Code-Flow-Automation/m-p/5377400#M4517</link>
      <description>&lt;P&gt;I have exactly the same problem. I am using the&amp;nbsp;&lt;SPAN&gt;Authorization Code Flow for an interactive CLI. However I am not able to test my code with an CI workflow, because there is no automatic way for me to authenticate. Hopefully there will be a solution to this problem soon.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 20:29:33 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Authorization-Code-Flow-Automation/m-p/5377400#M4517</guid>
      <dc:creator>fabieu</dc:creator>
      <dc:date>2022-05-03T20:29:33Z</dc:date>
    </item>
  </channel>
</rss>

