Hey community, nice that you are so active in here
I try to get the Spotify binding running…. without succes after a whole day testing.
First I am a bloodie beginner in OpenHAB.
But it seems that the binding always force to rediret to a http adress.
Spotify only allow https, so I configured everything to https and port 443. Everything works well.
OH is reachable with puplic domain and https and http is also redirecting to https.
Nginx with certificate is running well.
I deleted the addon and the bridge several times and tried to force OH to use https.
But everythime the url (https://mydomain/connectspotify) shows: http://mydomain/connectspotify
http without “s”. And the butten contains the http too.
If I try to copie the button adress and change the http to https manually i got an error message.
(Call to Spotify failed with error: null)
If I try to use the http I get the message invalid redirect url, because spotify is only allowing https addresses.
Maybe you have some idea for a beginnner
Thanks a lot
Getting this binding appears to have more steps than most. I don’t use Spotify so I can only go based on the docs.
It’s not super clear to me where you are in the steps but I think it might be step 6, or is it step 7?
Are you able to bring up the page hosted by OH in step 6 and it’s failing to go to Spotify when you click the “Authorize Player” button, or are you failing to bring up the OH hosted page itself?
It doesn’t matter if the OH hosted page is http. That’s just you talking with OH directly. The Spotify binding should be making all the subsequent HTTP calls and redirects to HTTPs appropriately.
I recommend you simplifying at least for these initial configuration steps. Don’t go through the nginx revers proxy. Bring up http://<ip address of your OH machine>:8080/connectspotify from a machine on your LAN. Or if you insist on HTTPS bring up https://<ip address of your OH machine>:8443/connectspotify (note it will be a self signed certificate so you’ll get an error/warning in the browser). Don’t forget to change the redirect URL in the Spotify Application.
Your OH does not need to be accessible from the Internet to make this work. It just needs to be accessible from the browser you are using to set up this OAuth registration.
The general flow is you bring up a web page on the app you want to authrize: http://openhab:8080/connectspotify
Then you make some action on that web page to initiate the OAuth approval. Authorize Player
This causes your browser to load a page from Spotify. Log in and fill out all the required stuff Spotify presents to authorize the connection and then Spotify will redirect your browser to load a page on the local app with a token as part of the URL. But that URL is the URL you registered with Spotify when you created the application.
The local app (i.e. OH) gets that token and uses it to register for an access token from Spotify directly.
So your OH needs to be able to reach Spotify and the browser you are using needs to be able to reach both OH and Spotify, but Spotify does not need to be able to reach your OH.
It kind of sounds like the redirect URL you registered with Spotify is not correct, but it’s hard to tell.
thanks.
I did not understand that the connection from outside is not necessary and tried it about wrong links…
Now it works well and everything is set up.
Thanks a lot for explaining in easy words
My question when it will again be possible to authorise, I get the following answer from Spotify support (German translated into English):
We in customer support don't have precise information on this, but as things stand, the feature won't be available again and will remain as it is for the time being. We welcome your feedback so we can forward it to the appropriate team. You can start a discussion and share your thoughts in our community: https://community.spotify.com/.
Existing apps (registered before the change) will continue to work with openHAB, but new apps cannot be created. The only solution is to find someone with an existing app (e.g., from the openHAB community forums) who is willing to temporarily share their Client ID/Secret and then enter it into your openHAB Spotify Bridge configuration at http://your-openhab:8080/connectspotify.
Yes, a single Spotify Customer ID can be used by multiple Spotify user accounts.
Is anybody willing to share a Spotify ID and password with me?