Read the statement by Michael Teeuw here.
MMM-Spotify having trouble with authentification
-
I am trying to install the MMM-Spotify module onto my magic mirror. I follow the steps on the github page and everything seems to be working up until the authentication stage. The Spotify popup opens after I run the node first_auth.js command in the terminal, but when I click allow in the new webpage I get an error, “This site can’t be reached localhost refused to connect.” Any ideas on how to fix this, any help would be appreciated.
-
@Jack_Gregorski Are you using a free or premium account? The free account will not work. See https://github.com/skuethe/MMM-Spotify#restrictions
-
@Jack_Gregorski on the redirect url in the Spotify config did you use http://localhost:8888/callback
as per the readme?
that url should show on the error page
-
@Jack_Gregorski ok, i see the same thing…
workaround
change Spotify.js
fromline 249-250
let file = path.resolve(__dirname, this.config.TOKEN) let waitForFileTimeout = 0
to
let file = path.resolve(__dirname, this.config.TOKEN) let waitForFileTimeout = 60*1000
basically the code sets up the server to listen for the callback, but doesn’t wait for you to interact with the web page
opened issue
https://github.com/skuethe/MMM-Spotify/issues/192 -
@Jack_Gregorski said in MMM-Spotify having trouble with authentification:
I am trying to install the MMM-Spotify module onto my magic mirror. I follow the steps on the github page and everything seems to be working up until the authentication stage. The Spotify popup opens after I run the node first_auth.js command in the terminal, but when I click allow in the new webpage I get an error, “This site can’t be reached localhost refused to connect.” Any ideas on how to fix this, any help would be appreciated.
-
@kinggiotai can you tell which module you are using
git remote -v
in the module folder will tell the source repository
-
@kinggiotai did you setup the spotify.config.json from the
auth callback example?
[ { "USERNAME": "A_NAME_TO_IDENTIFY_YOUR_ACCOUNT", "CLIENT_ID": "PUT_YOUR_SPOTIFY_APP_CLIENT_ID", "CLIENT_SECRET": "PUT_YOUR_SPOTIFY_APP_CLIENT_SECRET", "TOKEN": "./USERNAME_token.json", "AUTH_DOMAIN": "http://YOUR_DEVICES_IP", "AUTH_PORT": "8889" } ]
I had to do that just now
the domain/port MUST match the callback address in the spotify app config
from my app configcallback http://localhost:8100/callback
json file strings to match
domain is http://localhost
port is 8100