title: How to get access token from redirect url
body: <p>I want to get a <code>access token</code> from <code>Spotify</code>. I get from <code>Spotify</code> some this:</p>
  
  <blockquote>
    <p><a href="https://example.com/callback#access_token=NwAExz...BV3O2Tk&amp;token_type=Bearer&amp;expires_in=3600&amp;state=123" rel="nofollow noreferrer">https://example.com/callback#access_token=NwAExz...BV3O2Tk&amp;token_type=Bearer&amp;expires_in=3600&amp;state=123</a></p>
  </blockquote>
  
  <p>I see it into address bar. Where <code>https://example.com/callback</code> is my site and <code>access_token</code> needed value. How to get it?</p>
  
  <p>I tried like this, but get <code>None</code></p>
  
  <pre><code>print(flask.request.args.get('access_token'))
  </code></pre>
  
  <p>Full code</p>
  
  <pre><code>import flask 
  app = flask.Flask(__name__)
  
  @app.route("/")
  def render_index():
      return flask.render_template('index.html')
  
  @app.route("/redirect_spotify_token", methods = ['POST'])
  def redirect_spotify_token():
      return flask.redirect('https://accounts.spotify.com/authorize?...')
  
  @app.route("/callback/spotify_token", methods = ['POST', 'GET'])
  def callback_token():
    #
    # how to get access token?
    #
    return 'ok'
  
  if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8080) 
  </code></pre>