<?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 Issue with Missing refresh_token in Spotify iOS SDK Authorization Flow in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Issue-with-Missing-refresh-token-in-Spotify-iOS-SDK/m-p/6320779#M14982</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;Brasil&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Macbook M2 2023&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;macOS Sonoma 14.6.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am developing an iOS application using the Spotify iOS SDK and am facing difficulties obtaining the refresh_token after the authorization request. I followed the steps described in the documentation and successfully retrieve the access_token, but the refresh_token, which theoretically should be returned along with the access_token, is missing from the response.&lt;/P&gt;&lt;P&gt;Here are more details about my implementation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I used the authorization flow that involves requesting access permission via OAuth.&lt;/LI&gt;&lt;LI&gt;After authorization, I receive the access_token correctly, but the refresh_token is not included in the API response.&lt;/LI&gt;&lt;LI&gt;The flow I'm using is based on the example provided in the official SDK documentation.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could you please guide me on what might be causing this issue or provide more information on how to resolve it?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I used a print statement to check what I was getting as a return from the setAccessToken method, and this was the result:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;func&lt;/STRONG&gt;&lt;/SPAN&gt; setAccessToken&lt;SPAN class=""&gt;(&lt;/SPAN&gt;from&lt;SPAN class=""&gt; url: &lt;/SPAN&gt;&lt;SPAN class=""&gt;URL&lt;/SPAN&gt;&lt;SPAN class=""&gt;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; parameters = &lt;SPAN class=""&gt;appRemote&lt;/SPAN&gt;.authorizationParameters(from: url)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;//Print Parameters&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; parameters = parameters {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;"Authorization Parameters:"&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;/SPAN&gt; (key, value) &lt;SPAN class=""&gt;&lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/SPAN&gt; parameters {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"&lt;/SPAN&gt;\(key)&lt;SPAN class=""&gt;: &lt;/SPAN&gt;\(value)&lt;SPAN class=""&gt;"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; accessToken = parameters?[SPTAppRemoteAccessTokenKey] {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;appRemote&lt;/SPAN&gt;.connectionParameters.&lt;SPAN class=""&gt;accessToken&lt;/SPAN&gt; = accessToken&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;self&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;SPAN class=""&gt;accessToken&lt;/SPAN&gt; = accessToken&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Access Token: &lt;/SPAN&gt;\(accessToken)&lt;SPAN class=""&gt;"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;} &lt;SPAN class=""&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; errorDescription = parameters?[SPTAppRemoteErrorDescriptionKey] {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Error: &lt;/SPAN&gt;\(errorDescription)&lt;SPAN class=""&gt;"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Result I got:&lt;BR /&gt;{&lt;BR /&gt;"expires_in": 3600,&lt;BR /&gt;"token_type": "Bearer",&lt;BR /&gt;"spotify_version": "8.9.68.490",&lt;BR /&gt;"access_token": "BQAPe....vA9cdtAI-wE"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Result I was expecting:&lt;BR /&gt;{&lt;BR /&gt;"expires_in": 3600,&lt;BR /&gt;"token_type": "Bearer",&lt;BR /&gt;"spotify_version": "8.9.68.490",&lt;BR /&gt;"access_token": "BQAPe...vA9cdtAI-wE",&lt;BR /&gt;"refresh_token": "AQC2skl...P9GfhTnki9"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Sep 2024 20:41:21 GMT</pubDate>
    <dc:creator>Victorsaccucci</dc:creator>
    <dc:date>2024-09-06T20:41:21Z</dc:date>
    <item>
      <title>Issue with Missing refresh_token in Spotify iOS SDK Authorization Flow</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Issue-with-Missing-refresh-token-in-Spotify-iOS-SDK/m-p/6320779#M14982</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;Brasil&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Macbook M2 2023&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;macOS Sonoma 14.6.1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am developing an iOS application using the Spotify iOS SDK and am facing difficulties obtaining the refresh_token after the authorization request. I followed the steps described in the documentation and successfully retrieve the access_token, but the refresh_token, which theoretically should be returned along with the access_token, is missing from the response.&lt;/P&gt;&lt;P&gt;Here are more details about my implementation:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I used the authorization flow that involves requesting access permission via OAuth.&lt;/LI&gt;&lt;LI&gt;After authorization, I receive the access_token correctly, but the refresh_token is not included in the API response.&lt;/LI&gt;&lt;LI&gt;The flow I'm using is based on the example provided in the official SDK documentation.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Could you please guide me on what might be causing this issue or provide more information on how to resolve it?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; I used a print statement to check what I was getting as a return from the setAccessToken method, and this was the result:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;func&lt;/STRONG&gt;&lt;/SPAN&gt; setAccessToken&lt;SPAN class=""&gt;(&lt;/SPAN&gt;from&lt;SPAN class=""&gt; url: &lt;/SPAN&gt;&lt;SPAN class=""&gt;URL&lt;/SPAN&gt;&lt;SPAN class=""&gt;) {&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; parameters = &lt;SPAN class=""&gt;appRemote&lt;/SPAN&gt;.authorizationParameters(from: url)&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;//Print Parameters&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; parameters = parameters {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;"Authorization Parameters:"&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;for&lt;/STRONG&gt;&lt;/SPAN&gt; (key, value) &lt;SPAN class=""&gt;&lt;STRONG&gt;in&lt;/STRONG&gt;&lt;/SPAN&gt; parameters {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"&lt;/SPAN&gt;\(key)&lt;SPAN class=""&gt;: &lt;/SPAN&gt;\(value)&lt;SPAN class=""&gt;"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;&amp;nbsp;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; accessToken = parameters?[SPTAppRemoteAccessTokenKey] {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;appRemote&lt;/SPAN&gt;.connectionParameters.&lt;SPAN class=""&gt;accessToken&lt;/SPAN&gt; = accessToken&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;STRONG&gt;self&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;SPAN class=""&gt;accessToken&lt;/SPAN&gt; = accessToken&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Access Token: &lt;/SPAN&gt;\(accessToken)&lt;SPAN class=""&gt;"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;} &lt;SPAN class=""&gt;&lt;STRONG&gt;else&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;if&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class=""&gt;&lt;STRONG&gt;let&lt;/STRONG&gt;&lt;/SPAN&gt; errorDescription = parameters?[SPTAppRemoteErrorDescriptionKey] {&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class=""&gt;print&lt;/SPAN&gt;(&lt;SPAN class=""&gt;"Error: &lt;/SPAN&gt;\(errorDescription)&lt;SPAN class=""&gt;"&lt;/SPAN&gt;)&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Result I got:&lt;BR /&gt;{&lt;BR /&gt;"expires_in": 3600,&lt;BR /&gt;"token_type": "Bearer",&lt;BR /&gt;"spotify_version": "8.9.68.490",&lt;BR /&gt;"access_token": "BQAPe....vA9cdtAI-wE"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Result I was expecting:&lt;BR /&gt;{&lt;BR /&gt;"expires_in": 3600,&lt;BR /&gt;"token_type": "Bearer",&lt;BR /&gt;"spotify_version": "8.9.68.490",&lt;BR /&gt;"access_token": "BQAPe...vA9cdtAI-wE",&lt;BR /&gt;"refresh_token": "AQC2skl...P9GfhTnki9"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2024 20:41:21 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Issue-with-Missing-refresh-token-in-Spotify-iOS-SDK/m-p/6320779#M14982</guid>
      <dc:creator>Victorsaccucci</dc:creator>
      <dc:date>2024-09-06T20:41:21Z</dc:date>
    </item>
  </channel>
</rss>

