<?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: User authenication with python in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500361#M7884</link>
    <description>&lt;P&gt;Okay, maybe &lt;A href="https://stackoverflow.com/questions/75286588/spotify-web-api-call-gives-wrong-code-python/75292843#75292843" target="_blank" rel="noopener"&gt;this answer&lt;/A&gt; on Stack Overflow can help you?&lt;/P&gt;</description>
    <pubDate>Sun, 05 Feb 2023 15:32:37 GMT</pubDate>
    <dc:creator>Ximzend</dc:creator>
    <dc:date>2023-02-05T15:32:37Z</dc:date>
    <item>
      <title>User authenication with python</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500308#M7879</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to make a user authentication using python scripts.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I retrieve the auth_headers:&lt;/P&gt;&lt;P&gt;auth_headers = {&lt;BR /&gt;"client_id": client_id,&lt;BR /&gt;"response_type": "code",&lt;BR /&gt;"redirect_uri": "&lt;A href="http://localhost:7777/callback" target="_blank"&gt;http://localhost:7777/callback&lt;/A&gt;",&lt;BR /&gt;"scope": "user-library-read"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;r = webbrowser.open("&lt;A href="https://accounts.spotify.com/authorize" target="_blank"&gt;https://accounts.spotify.com/authorize&lt;/A&gt;?" + urlencode(auth_headers))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I get the code from the callback url "code=..."&lt;/P&gt;&lt;P&gt;code = "...."&lt;/P&gt;&lt;P&gt;encoded_credentials = base64.b64encode(client_id.encode() + b':' + client_secret.encode()).decode("utf-8")&lt;/P&gt;&lt;P&gt;token_headers = {&lt;BR /&gt;"Authorization": "Basic " + encoded_credentials,&lt;BR /&gt;"Content-Type": "application/x-www-form-urlencoded"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;token_data = {&lt;BR /&gt;"grant_type": "authorization_code",&lt;BR /&gt;"code": code,&lt;BR /&gt;"redirect_uri": "&lt;A href="http://localhost:7777/callback" target="_blank"&gt;http://localhost:7777/callback&lt;/A&gt;"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;r = requests.post("&lt;A href="https://accounts.spotify.com/api/token" target="_blank"&gt;https://accounts.spotify.com/api/token&lt;/A&gt;", data=token_data, headers=token_headers)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So my problem is I have to run the first script to get the authorization code whenever I refresh. Is there anyway to automate this process? Thank you so much&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 11:15:05 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500308#M7879</guid>
      <dc:creator>Nauqh</dc:creator>
      <dc:date>2023-02-05T11:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: User authenication with python</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500313#M7880</link>
      <description>&lt;P&gt;With the Python module SpotiPy (&lt;A href="https://github.com/spotipy-dev/spotipy" target="_blank" rel="noopener"&gt;GitHub&lt;/A&gt; | &lt;A href="https://spotipy.readthedocs.io/en/latest/" target="_blank" rel="noopener"&gt;Documentation&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 11:32:34 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500313#M7880</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-02-05T11:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: User authenication with python</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500340#M7883</link>
      <description>&lt;P&gt;Thank you for your suggestion. I have already used it for a while, but I am trying to write my own request using plain python for studying purpose so I am looking for a pure python way instead.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 14:02:38 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500340#M7883</guid>
      <dc:creator>Nauqh</dc:creator>
      <dc:date>2023-02-05T14:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: User authenication with python</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500361#M7884</link>
      <description>&lt;P&gt;Okay, maybe &lt;A href="https://stackoverflow.com/questions/75286588/spotify-web-api-call-gives-wrong-code-python/75292843#75292843" target="_blank" rel="noopener"&gt;this answer&lt;/A&gt; on Stack Overflow can help you?&lt;/P&gt;</description>
      <pubDate>Sun, 05 Feb 2023 15:32:37 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500361#M7884</guid>
      <dc:creator>Ximzend</dc:creator>
      <dc:date>2023-02-05T15:32:37Z</dc:date>
    </item>
    <item>
      <title>Re: User authenication with python</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500516#M7889</link>
      <description>&lt;P&gt;I think this is what im looking for, thank you so much&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 02:57:39 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/User-authenication-with-python/m-p/5500516#M7889</guid>
      <dc:creator>Nauqh</dc:creator>
      <dc:date>2023-02-06T02:57:39Z</dc:date>
    </item>
  </channel>
</rss>

