Invalid redirect URI on spotify auth

前端 未结 11 1249
日久生厌
日久生厌 2021-02-03 16:56

I try to auth user through my app with spotify Web API but I receive this error:

INVALID_CLIENT: Invalid redirect URI

URL:

GET         


        
相关标签:
11条回答
  • 2021-02-03 17:41

    +1 to adding 'http://localhost:8888/callback' to the Redirect URIs list in your App's settings via https://developer.spotify.com/dashboard/applications

    It's a shame this is not mentioned on the quick start: https://developer.spotify.com/documentation/web-playback-sdk/quick-start/

    0 讨论(0)
  • 2021-02-03 17:44

    You have to add the redirect URI to the White-list in "My Applications" panel.

    e.g http://example.com/callback/

    0 讨论(0)
  • 2021-02-03 17:44

    app.js:

    var redirect_uri = 'http://localhost:8888/callback';
    

    (https://developer.spotify.com/dashboard) Spotify > My application:

    http://localhost:8888/callback
    

    Dont forget to save.

    0 讨论(0)
  • 2021-02-03 17:46

    I ran into a similar issue when authenticated via Authorization Code Flow.

    Per the docs The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code. So make sure that the:

    1. redirect_uri that is configured in the dashboard
    2. redirect_uri in the GET https://accounts.spotify.com/authorize
    3. redirect_uri in the POST https://accounts.spotify.com/api/token

    is exactly the same or else you will get a INVALID_CLIENT: Invalid redirect URI

    0 讨论(0)
  • 2021-02-03 17:51

    I played around with various URLs for some time, none of them gave me the correct functionality except http://localhost:8888/callback/ (note the trailing slash). Be sure to add that to the whitelist as well.

    0 讨论(0)
提交回复
热议问题