<?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 Invalid Client Error w/Spotify Web API in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Invalid-Client-Error-w-Spotify-Web-API/m-p/5602765#M9791</link>
    <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Free/Premium&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;United States&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;My team and I are getting a "Invalid Client" / WebapiAuthenticationError: An authentication error occurred while communicating with Spotify's Web API error&lt;BR /&gt;&lt;BR /&gt;We can confirm that we have quadruple checked the client id and client secret in our being the exact same from our dev dashboard, we can confirm that we recreated a client secret as well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Our use case is simple, we created a cloud function via firebase that makes endpoint calls to the Spotify Web Api every 30 minutes to extract our apps user most recently played tracks from spotify. Here's a small example snippet of the begging of our code structure to reference my use case above.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; functions = require(&lt;/SPAN&gt;&lt;SPAN&gt;"firebase-functions"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; admin = require(&lt;/SPAN&gt;&lt;SPAN&gt;"firebase-admin"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; SpotifyWebApi = require(&lt;/SPAN&gt;&lt;SPAN&gt;'spotify-web-api-node'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;admin.initializeApp();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;exports.getRecentSongs = functions.pubsub.schedule(&lt;/SPAN&gt;&lt;SPAN&gt;'every 30 minutes'&lt;/SPAN&gt;&lt;SPAN&gt;).onRun(&lt;/SPAN&gt;&lt;SPAN&gt;async&lt;/SPAN&gt;&lt;SPAN&gt; (context) &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Initialize Spotify Web API&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; spotifyApi = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; SpotifyWebApi({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;clientId: &lt;/SPAN&gt;&lt;SPAN&gt;'myclientid'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;clientSecret: &lt;/SPAN&gt;&lt;SPAN&gt;'myclientsecret'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;});&lt;BR /&gt;&lt;BR /&gt;(*&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-06-29 at 7.42.47 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.spotify.com/t5/image/serverpage/image-id/159528iF15974A182F43247/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-06-29 at 7.42.47 PM.png" alt="Screenshot 2023-06-29 at 7.42.47 PM.png" /&gt;&lt;/span&gt;&lt;SPAN&gt;see e rror code screenshot attached)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 30 Jun 2023 01:44:32 GMT</pubDate>
    <dc:creator>vidadev</dc:creator>
    <dc:date>2023-06-30T01:44:32Z</dc:date>
    <item>
      <title>Invalid Client Error w/Spotify Web API</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Invalid-Client-Error-w-Spotify-Web-API/m-p/5602765#M9791</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Plan&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Free/Premium&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Country&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;United States&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;My team and I are getting a "Invalid Client" / WebapiAuthenticationError: An authentication error occurred while communicating with Spotify's Web API error&lt;BR /&gt;&lt;BR /&gt;We can confirm that we have quadruple checked the client id and client secret in our being the exact same from our dev dashboard, we can confirm that we recreated a client secret as well.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Our use case is simple, we created a cloud function via firebase that makes endpoint calls to the Spotify Web Api every 30 minutes to extract our apps user most recently played tracks from spotify. Here's a small example snippet of the begging of our code structure to reference my use case above.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; functions = require(&lt;/SPAN&gt;&lt;SPAN&gt;"firebase-functions"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; admin = require(&lt;/SPAN&gt;&lt;SPAN&gt;"firebase-admin"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; SpotifyWebApi = require(&lt;/SPAN&gt;&lt;SPAN&gt;'spotify-web-api-node'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;admin.initializeApp();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;exports.getRecentSongs = functions.pubsub.schedule(&lt;/SPAN&gt;&lt;SPAN&gt;'every 30 minutes'&lt;/SPAN&gt;&lt;SPAN&gt;).onRun(&lt;/SPAN&gt;&lt;SPAN&gt;async&lt;/SPAN&gt;&lt;SPAN&gt; (context) &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Initialize Spotify Web API&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt;&lt;SPAN&gt; spotifyApi = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; SpotifyWebApi({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;clientId: &lt;/SPAN&gt;&lt;SPAN&gt;'myclientid'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;clientSecret: &lt;/SPAN&gt;&lt;SPAN&gt;'myclientsecret'&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;});&lt;BR /&gt;&lt;BR /&gt;(*&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-06-29 at 7.42.47 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.spotify.com/t5/image/serverpage/image-id/159528iF15974A182F43247/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-06-29 at 7.42.47 PM.png" alt="Screenshot 2023-06-29 at 7.42.47 PM.png" /&gt;&lt;/span&gt;&lt;SPAN&gt;see e rror code screenshot attached)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 30 Jun 2023 01:44:32 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Invalid-Client-Error-w-Spotify-Web-API/m-p/5602765#M9791</guid>
      <dc:creator>vidadev</dc:creator>
      <dc:date>2023-06-30T01:44:32Z</dc:date>
    </item>
    <item>
      <title>Re: Invalid Client Error w/Spotify Web API</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Invalid-Client-Error-w-Spotify-Web-API/m-p/5602794#M9793</link>
      <description>&lt;P&gt;You should use code for the &lt;A href="https://github.com/thelinmichael/spotify-web-api-node#authorization-code-flow" target="_blank" rel="noopener"&gt;Authorization code flow&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;with the user-read-recently-played scope.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2023 04:58:33 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Invalid-Client-Error-w-Spotify-Web-API/m-p/5602794#M9793</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-06-30T04:58:33Z</dc:date>
    </item>
  </channel>
</rss>

