<?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 Problem with Spotify OAuth 2.0 + PKCE in React Native (Expo) – INVALID_CLIENT: Invalid redirect URI in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Problem-with-Spotify-OAuth-2-0-PKCE-in-React-Native-Expo-INVALID/m-p/6855696#M17364</link>
    <description>&lt;H3&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Devices:&lt;/STRONG&gt; iPhone 14 Simulator, iPhone 14 Pro (Real Device)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;OS Versions:&lt;/STRONG&gt; iOS 16.4, iOS 18.3.2&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Framework:&lt;/STRONG&gt; React Native (with Expo)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Auth Library:&lt;/STRONG&gt; expo-auth-session&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Authorization Flow:&lt;/STRONG&gt; Authorization Code Flow with &lt;STRONG&gt;PKCE enable&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;Problem Description&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;I'm implementing &lt;STRONG&gt;Spotify OAuth 2.0 with PKCE&lt;/STRONG&gt; in a React Native (Expo) app using expo-auth-session.&lt;/P&gt;&lt;P&gt;When usePKCE is set to false, everything works perfectly — the &lt;STRONG&gt;Authorization Code Flow without PKCE&lt;/STRONG&gt; works as expected, and I can successfully log in.&lt;/P&gt;&lt;P&gt;However, as soon as I switch to &lt;STRONG&gt;PKCE (usePKCE: true)&lt;/STRONG&gt;, I encounter this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;INVALID_CLIENT: Invalid redirect URI&lt;/SPAN&gt;&lt;BR /&gt;HTTP 400 Bad Request &lt;SPAN class=""&gt;status_text: (empty)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;What I've Checked&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;My &lt;STRONG&gt;redirect URIs&lt;/STRONG&gt; are &lt;STRONG&gt;correctly registered&lt;/STRONG&gt; in the Spotify Developer Dashboard&lt;/LI&gt;&lt;LI&gt;I’ve &lt;STRONG&gt;debugged with WebView&lt;/STRONG&gt; on both simulator and real device — nothing helpful surfaced.&lt;/LI&gt;&lt;LI&gt;I’ve &lt;STRONG&gt;manually generated and tested code_verifier and code_challenge&lt;/STRONG&gt;, following the PKCE specs.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Authorization Code Flow without PKCE works flawlessly.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Has anyone successfully implemented &lt;STRONG&gt;Spotify OAuth 2.0 + PKCE&lt;/STRONG&gt; in a React Native (Expo) app using expo-auth-session?&lt;/LI&gt;&lt;LI&gt;Could this be an issue with &lt;STRONG&gt;how Spotify handles PKCE&lt;/STRONG&gt; with custom redirect URIs?&lt;/LI&gt;&lt;LI&gt;Is there anything &lt;STRONG&gt;specifically required by Spotify&lt;/STRONG&gt; for PKCE to work that might be undocumented?&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Thanks in advance!&lt;/H3&gt;&lt;P&gt;If anyone has encountered this issue or found a working configuration for PKCE + Spotify + Expo, your input would be greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Fri, 21 Mar 2025 13:28:29 GMT</pubDate>
    <dc:creator>abayram</dc:creator>
    <dc:date>2025-03-21T13:28:29Z</dc:date>
    <item>
      <title>Problem with Spotify OAuth 2.0 + PKCE in React Native (Expo) – INVALID_CLIENT: Invalid redirect URI</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Problem-with-Spotify-OAuth-2-0-PKCE-in-React-Native-Expo-INVALID/m-p/6855696#M17364</link>
      <description>&lt;H3&gt;&lt;STRONG&gt;Environment&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Devices:&lt;/STRONG&gt; iPhone 14 Simulator, iPhone 14 Pro (Real Device)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;OS Versions:&lt;/STRONG&gt; iOS 16.4, iOS 18.3.2&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Framework:&lt;/STRONG&gt; React Native (with Expo)&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Auth Library:&lt;/STRONG&gt; expo-auth-session&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Authorization Flow:&lt;/STRONG&gt; Authorization Code Flow with &lt;STRONG&gt;PKCE enable&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;Problem Description&lt;/STRONG&gt;&lt;/H3&gt;&lt;P&gt;I'm implementing &lt;STRONG&gt;Spotify OAuth 2.0 with PKCE&lt;/STRONG&gt; in a React Native (Expo) app using expo-auth-session.&lt;/P&gt;&lt;P&gt;When usePKCE is set to false, everything works perfectly — the &lt;STRONG&gt;Authorization Code Flow without PKCE&lt;/STRONG&gt; works as expected, and I can successfully log in.&lt;/P&gt;&lt;P&gt;However, as soon as I switch to &lt;STRONG&gt;PKCE (usePKCE: true)&lt;/STRONG&gt;, I encounter this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;INVALID_CLIENT: Invalid redirect URI&lt;/SPAN&gt;&lt;BR /&gt;HTTP 400 Bad Request &lt;SPAN class=""&gt;status_text: (empty)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;What I've Checked&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;My &lt;STRONG&gt;redirect URIs&lt;/STRONG&gt; are &lt;STRONG&gt;correctly registered&lt;/STRONG&gt; in the Spotify Developer Dashboard&lt;/LI&gt;&lt;LI&gt;I’ve &lt;STRONG&gt;debugged with WebView&lt;/STRONG&gt; on both simulator and real device — nothing helpful surfaced.&lt;/LI&gt;&lt;LI&gt;I’ve &lt;STRONG&gt;manually generated and tested code_verifier and code_challenge&lt;/STRONG&gt;, following the PKCE specs.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Authorization Code Flow without PKCE works flawlessly.&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;&lt;STRONG&gt;Questions&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Has anyone successfully implemented &lt;STRONG&gt;Spotify OAuth 2.0 + PKCE&lt;/STRONG&gt; in a React Native (Expo) app using expo-auth-session?&lt;/LI&gt;&lt;LI&gt;Could this be an issue with &lt;STRONG&gt;how Spotify handles PKCE&lt;/STRONG&gt; with custom redirect URIs?&lt;/LI&gt;&lt;LI&gt;Is there anything &lt;STRONG&gt;specifically required by Spotify&lt;/STRONG&gt; for PKCE to work that might be undocumented?&lt;/LI&gt;&lt;/UL&gt;&lt;H3&gt;Thanks in advance!&lt;/H3&gt;&lt;P&gt;If anyone has encountered this issue or found a working configuration for PKCE + Spotify + Expo, your input would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Mar 2025 13:28:29 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Problem-with-Spotify-OAuth-2-0-PKCE-in-React-Native-Expo-INVALID/m-p/6855696#M17364</guid>
      <dc:creator>abayram</dc:creator>
      <dc:date>2025-03-21T13:28:29Z</dc:date>
    </item>
  </channel>
</rss>

