Setting localhost as a Spotify redirect_uri

℡╲_俬逩灬. 提交于 2019-12-10 13:46:39

问题


I've looked here on SO and I've found a few posts about redirect_uri but I can't seem to figure out how I use Localhost as my redirect uri . Hopefully anyone can explain this to me.

With kind regards,


回答1:


You can follow the steps described in the Spotify's Web API Beginner's Tutorial, which runs a local server and uses localhost as part of the redirect_uri.

Localhost URLs are valid as redirect_uri and useful for development purposes, though once you make your project public you will need to switch to a URL with a custom domain or IP so the request reaches your server.

What I normally do is to set up two redirect_uris, one with localhost and another one with a domain. Then in your code you use one or the other depending on the hostname. You can see an example.



来源:https://stackoverflow.com/questions/38198071/setting-localhost-as-a-spotify-redirect-uri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!