<?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 API Authorization header doesn't follow HTTP spec in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/API-Authorization-header-doesn-t-follow-HTTP-spec/m-p/5397381#M4917</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found that the Authorization header doesn't follow the HTTP spec (&lt;A href="https://datatracker.ietf.org/doc/html/rfc7235#section-2.1" target="_blank" rel="noopener"&gt;https://datatracker.ietf.org/doc/html/rfc7235#section-2.1&lt;/A&gt;). The spec says the scheme can be case insensitve, however Spotify's API expects it to be case-sensitive, that is, it forces it to be "Bearer" and "bearer" is not allowed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this break some HTTP client libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can be easily tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl --request GET&amp;nbsp;'&lt;A href="https://api.spotify.com/v1/tracks/SOME_ID" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/tracks/SOME_ID&lt;/A&gt;'&amp;nbsp;--header "Authorization: bearer TOKEN"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which returns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{\n \"error\": {\n \"status\": 400,\n \"message\": \"Only valid bearer authentication supported\"\n }\n}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, passing "Bearer" instead using the same token works:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;curl --request GET&amp;nbsp;'&lt;A href="https://api.spotify.com/v1/tracks/SOME_ID" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/tracks/SOME_ID&lt;/A&gt;'&amp;nbsp;--header "Authorization: Bearer TOKEN"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great if this issue could be fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jun 2022 21:10:04 GMT</pubDate>
    <dc:creator>aconchillo</dc:creator>
    <dc:date>2022-06-23T21:10:04Z</dc:date>
    <item>
      <title>API Authorization header doesn't follow HTTP spec</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/API-Authorization-header-doesn-t-follow-HTTP-spec/m-p/5397381#M4917</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've found that the Authorization header doesn't follow the HTTP spec (&lt;A href="https://datatracker.ietf.org/doc/html/rfc7235#section-2.1" target="_blank" rel="noopener"&gt;https://datatracker.ietf.org/doc/html/rfc7235#section-2.1&lt;/A&gt;). The spec says the scheme can be case insensitve, however Spotify's API expects it to be case-sensitive, that is, it forces it to be "Bearer" and "bearer" is not allowed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, this break some HTTP client libraries.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can be easily tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;curl --request GET&amp;nbsp;'&lt;A href="https://api.spotify.com/v1/tracks/SOME_ID" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/tracks/SOME_ID&lt;/A&gt;'&amp;nbsp;--header "Authorization: bearer TOKEN"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which returns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{\n \"error\": {\n \"status\": 400,\n \"message\": \"Only valid bearer authentication supported\"\n }\n}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, passing "Bearer" instead using the same token works:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;curl --request GET&amp;nbsp;'&lt;A href="https://api.spotify.com/v1/tracks/SOME_ID" target="_blank" rel="noopener"&gt;https://api.spotify.com/v1/tracks/SOME_ID&lt;/A&gt;'&amp;nbsp;--header "Authorization: Bearer TOKEN"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It would be great if this issue could be fixed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jun 2022 21:10:04 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/API-Authorization-header-doesn-t-follow-HTTP-spec/m-p/5397381#M4917</guid>
      <dc:creator>aconchillo</dc:creator>
      <dc:date>2022-06-23T21:10:04Z</dc:date>
    </item>
  </channel>
</rss>

