<?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 Re: [iOS] Spotify iOS SDK give invalid client secret error when authorise via Spotify app in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280127#M3435</link>
    <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I aslo found another workaround, instead of using&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sessionManager&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;application&lt;/SPAN&gt;&lt;SPAN&gt;(app, &lt;/SPAN&gt;&lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;: url, &lt;/SPAN&gt;&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;: options)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I made a call to /token with the code provided by spotify app, then pass in client_secret in the request.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This worked but storing client secret in the code is not recommended.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Oct 2021 09:29:27 GMT</pubDate>
    <dc:creator>teehyen</dc:creator>
    <dc:date>2021-10-20T09:29:27Z</dc:date>
    <item>
      <title>[iOS] Spotify iOS SDK give invalid client secret error when authorise via Spotify app</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280041#M3431</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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Device&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(iPhone 11 Pro Max)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Operating System&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;(iOS 14.7.1.)&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;Our app is using iOS Spotify SDK to manage user playlists. The app use&amp;nbsp;&lt;/P&gt;&lt;P&gt;SPTSessionManager to authenticate the user&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is working fine in&amp;nbsp;&lt;SPAN&gt;8.6.56 but it is not working with recent Spotify app releases (8.6.68, 8.6.70)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the flow we are using:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- The app initiateSession:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sessionManager&lt;/SPAN&gt;.initiateSession(&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;with: [.playlistModifyPublic, .playlistModifyPrivate, .playlistReadPrivate],&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;options: [.&lt;SPAN&gt;default&lt;/SPAN&gt;]&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;- The Spotify app will be opened&lt;/P&gt;&lt;P&gt;- &amp;nbsp;&lt;SPAN&gt;The&amp;nbsp;Spotify called a oAuth endpoint&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://accounts.spotify.com/oauth2/v2/auth?client_id=XXXX&amp;amp;response_type=code&amp;amp;redirect_uri=XXXX&amp;amp;client_app_id&amp;amp;id_token_hint=XXXX&amp;amp;prompt=none&amp;amp;scope=playlist-read-private%20playlist-modify-public%20playlist-modify-private" target="_blank" rel="noopener"&gt;https://accounts.spotify.com/oauth2/v2/auth?client_id=XXXX&amp;amp;response_type=code&amp;amp;redirect_uri=XXXX&amp;amp;client_app_id&amp;amp;id_token_hint=XXXX&amp;amp;prompt=none&amp;amp;scope=playlist-read-private%20playlist-modify-public%20playlist-modify-private&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Then Spotify app give my app the deeplink like &amp;nbsp;this&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;app://spotify/?code=XXXX&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- Then inside our app we called&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;sessionManager&lt;SPAN&gt;.&lt;/SPAN&gt;application&lt;SPAN&gt;(app, &lt;/SPAN&gt;open&lt;SPAN&gt;: url, &lt;/SPAN&gt;options&lt;SPAN&gt;: options)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;- This called returned&amp;nbsp;{"error":"invalid_request","error_description":"Invalid client secret"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It is working when I run local server and added tokenSwapURL and tokenRefreshURL. However this is not an option for us to have a additional server.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It is also working when I force the&amp;nbsp;web view authorisation by removing "s&lt;/SPAN&gt;potify" out of&amp;nbsp;LSApplicationQueriesSchemes. But this is not a desired UX flow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some change recently that I should be aware of? How do we fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks for your time.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 06:19:23 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280041#M3431</guid>
      <dc:creator>teehyen</dc:creator>
      <dc:date>2021-10-20T06:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: [iOS] Spotify iOS SDK give invalid client secret error when authorise via Spotify app</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280108#M3433</link>
      <description>&lt;P&gt;I'm also having this issue for past few days on iOS. As you have mentioned the scenarios where it works. I also found one, it also works when we login the Spotify app with Sri Lankan account. I have tried changing the country using VPN but it does not works. Only works when we use Sri Lankan account, thats weird but its happening.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 08:43:51 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280108#M3433</guid>
      <dc:creator>Usama2810</dc:creator>
      <dc:date>2021-10-20T08:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: [iOS] Spotify iOS SDK give invalid client secret error when authorise via Spotify app</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280127#M3435</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;I aslo found another workaround, instead of using&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sessionManager&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;application&lt;/SPAN&gt;&lt;SPAN&gt;(app, &lt;/SPAN&gt;&lt;SPAN&gt;open&lt;/SPAN&gt;&lt;SPAN&gt;: url, &lt;/SPAN&gt;&lt;SPAN&gt;options&lt;/SPAN&gt;&lt;SPAN&gt;: options)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I made a call to /token with the code provided by spotify app, then pass in client_secret in the request.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This worked but storing client secret in the code is not recommended.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Oct 2021 09:29:27 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280127#M3435</guid>
      <dc:creator>teehyen</dc:creator>
      <dc:date>2021-10-20T09:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: [iOS] Spotify iOS SDK give invalid client secret error when authorise via Spotify app</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280719#M3446</link>
      <description>&lt;P&gt;Thats great ! But I am stuck with this issue for days now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you said,&amp;nbsp;&lt;SPAN&gt;It is working when you run local server and added tokenSwapURL and tokenRefreshURL. However this is not an option for us to have a additional server.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you you please guide me, how are you running the local server for tokenSawap and refresh, because It does not hit the tokenSwap url in my app.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;here is my Spotify config:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;private&lt;/SPAN&gt; &lt;SPAN&gt;async&lt;/SPAN&gt; &lt;SPAN&gt;authenticate&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;playURI&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;showDialog&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;authType&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}: &lt;/SPAN&gt;&lt;SPAN&gt;AuthOptions&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;config&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;ApiConfig&lt;/SPAN&gt;&lt;SPAN&gt; = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;clientID&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;id&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;redirectURL&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;redirect&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// tokenRefreshURL: '&lt;A href="https://spinsapi.pixarsclients.com/public/api/v1/spotify/swap" target="_blank" rel="noopener"&gt;https://spinsapi.pixarsclients.com/public/api/v1/spotify/swap&lt;/A&gt;',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// tokenSwapURL: '&lt;A href="https://spinsapi.pixarsclients.com/public/api/v1/spotify/swap" target="_blank" rel="noopener"&gt;https://spinsapi.pixarsclients.com/public/api/v1/spotify/swap&lt;/A&gt;',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;scopes&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;SPAN&gt; [&lt;/SPAN&gt;&lt;SPAN&gt;ApiScope&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;AppRemoteControlScope&lt;/SPAN&gt;&lt;SPAN&gt;],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;playURI&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;showDialog&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;authType&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;};&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;try&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Go and check if things are connected&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;const&lt;/SPAN&gt; &lt;SPAN&gt;isConnected&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;await&lt;/SPAN&gt; &lt;SPAN&gt;remote&lt;/SPAN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t;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Oct 2021 06:28:43 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5280719#M3446</guid>
      <dc:creator>Usama2810</dc:creator>
      <dc:date>2021-10-21T06:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: [iOS] Spotify iOS SDK give invalid client secret error when authorise via Spotify app</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5284808#M3493</link>
      <description>Not sure how it works on node but for me it worked when I implemented this flow &lt;A href="https://developer.spotify.com/documentation/general/guides/authorization/implicit-grant/" target="_blank"&gt;https://developer.spotify.com/documentation/general/guides/authorization/implicit-grant/&lt;/A&gt;&lt;BR /&gt;Hope it helps.</description>
      <pubDate>Thu, 28 Oct 2021 00:16:09 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/iOS-Spotify-iOS-SDK-give-invalid-client-secret-error-when/m-p/5284808#M3493</guid>
      <dc:creator>teehyen</dc:creator>
      <dc:date>2021-10-28T00:16:09Z</dc:date>
    </item>
  </channel>
</rss>

