<?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 Auth API Invalid Client: Invalid Redirect URI in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Auth-API-Invalid-Client-Invalid-Redirect-URI/m-p/5364756#M4352</link>
    <description>&lt;P&gt;I access Spotify API on my local machine without any problem. I supply to spotify auth request my local address as redirect_uri parameter(&lt;A href="http://localhost:8080" target="_blank" rel="noopener"&gt;http://localhost:8080&lt;/A&gt;) and I also added this URI in the Spotify Developer Console to the whitelist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I deploy my app to AWS I have a url like this: &lt;A href="http://myapp-env.eu-west-2.elasticbeanstalk.com/" target="_blank" rel="noopener"&gt;http://myapp-env.eu-west-2.elasticbeanstalk.com/ &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I added this url to whitelist on Spotify Developer Console too and sending this url to Spotify authorization request as redirect_uri parameter. But this time spotify returns 'Invalid Client: Invalid Redirect URI' error. Is there something wrong with the AWS url?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I discovered that when you pass a uri that is whitelisted in the Spotify Developer Console, if the hostname of the machine making the request does not match the host of the uri, spotify returns invalid_redirect_uri.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So maybe it's because AWS has load balancing and the hostname of the machine is different than the url above. Is there any way to workaround this?&lt;/P&gt;</description>
    <pubDate>Sat, 09 Apr 2022 18:23:41 GMT</pubDate>
    <dc:creator>user-removed</dc:creator>
    <dc:date>2022-04-09T18:23:41Z</dc:date>
    <item>
      <title>Auth API Invalid Client: Invalid Redirect URI</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Auth-API-Invalid-Client-Invalid-Redirect-URI/m-p/5364756#M4352</link>
      <description>&lt;P&gt;I access Spotify API on my local machine without any problem. I supply to spotify auth request my local address as redirect_uri parameter(&lt;A href="http://localhost:8080" target="_blank" rel="noopener"&gt;http://localhost:8080&lt;/A&gt;) and I also added this URI in the Spotify Developer Console to the whitelist.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But when I deploy my app to AWS I have a url like this: &lt;A href="http://myapp-env.eu-west-2.elasticbeanstalk.com/" target="_blank" rel="noopener"&gt;http://myapp-env.eu-west-2.elasticbeanstalk.com/ &lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I added this url to whitelist on Spotify Developer Console too and sending this url to Spotify authorization request as redirect_uri parameter. But this time spotify returns 'Invalid Client: Invalid Redirect URI' error. Is there something wrong with the AWS url?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT: I discovered that when you pass a uri that is whitelisted in the Spotify Developer Console, if the hostname of the machine making the request does not match the host of the uri, spotify returns invalid_redirect_uri.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So maybe it's because AWS has load balancing and the hostname of the machine is different than the url above. Is there any way to workaround this?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 18:23:41 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Auth-API-Invalid-Client-Invalid-Redirect-URI/m-p/5364756#M4352</guid>
      <dc:creator>user-removed</dc:creator>
      <dc:date>2022-04-09T18:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Auth API Invalid Client: Invalid Redirect URI</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Auth-API-Invalid-Client-Invalid-Redirect-URI/m-p/5364797#M4353</link>
      <description>&lt;P data-unlink="true"&gt;I solved it. It's because I forgot to change the redirect uri of the &lt;A href="https://accounts.spotify.com/api/token" target="_blank"&gt;https://accounts.spotify.com/api/authorize&lt;/A&gt;&amp;nbsp;request and sent different (although valid) redirect uri in&amp;nbsp;https://accounts.spotify.com/api/token&amp;nbsp;request. The two must match.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Apr 2022 19:33:31 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Auth-API-Invalid-Client-Invalid-Redirect-URI/m-p/5364797#M4353</guid>
      <dc:creator>user-removed</dc:creator>
      <dc:date>2022-04-09T19:33:31Z</dc:date>
    </item>
  </channel>
</rss>

