owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.1k stars 237 forks source link

Can't authorize spotify #546

Closed fredericdepuydt closed 6 years ago

fredericdepuydt commented 6 years ago

I can't authorize spotify, the webpage is blank when I click the button on the website. How does the redirect url work? Does the spotify webpage need to be able to connect to that url? Since it's forked-daapd.local:3689/oauth/spotify.

I'm asking this because I run my Raspberry Pi headless (no webbrowser). So I open the forked-daapd webpage from a local PC in my network.

ejurgensen commented 6 years ago

Yes, it works very much like you say. To be precise:

  1. forked-daapd announces that the device has the address forked-daapd.local
  2. On any device on your lan you browse to http://forked-daapd.local:3689
  3. You select Spotify auth and get sent to spotify.com, where you enter credentials
  4. spotify.com redirects to http://forked-daapd.local:3689/oauth/spotify with the auth key

So the step that isn't working for you is number 2? Which probably means the client isn't registering the announcement in step 1. Advice for troubleshooting:

fredericdepuydt commented 6 years ago

I already added forked-daapd.local to my hosts file. Did the test with multiple webbrowsers, and it is the spotify website itself that stayed blank. The redirection didn't even happen.

After some testing I noticed it was my Pi-Hole who blocked the dns query for the spotify authorization. Disabling Pi-Hole for 30 seconds allowed me to authenticate succesfull.