Open 1ukastesar opened 2 months ago
Same issue i get :
Password authentication no longer supported, use OAuth
any way to solve this? Regards.
i also have this problem.
Same problem, got the auth token via librespot, but not sure where to put it so that Raspotify can see it
I suspect this can be solved by not using a dynamic user through systemd. This way, you will be able to write to raspotify's directory. I won't be able to test this until next week, however. Perhaps you could try it out.
Change /lib/systemd/system/raspotify.service
from
[Service]
DynamicUser=yes
to
[Service]
DynamicUser=no
Then run systemctl daemon-reload && systemctl restart raspotify
.
Thanks @kimtore, that worked perfectly!
For anyone landing here, below is a summary of the steps I followed to get this working on a Raspberry Pi 4 running Bullseye with Librespot v0.4.2. Note that although I had to compile librespot from source to run it and get the authentication token, I did not need to actually install it again overwriting the release version.
Stopped the raspotify service with systemctl stop raspotify
after noticing errors on the librespot logs: Connection failed: Login failed with reason: Bad credentials
Cloned the tip of the librespot repository to get the fix (no new release available at the time of writing, v0.4.2 was last release) and built it locally on the Raspberry Pi following instructions here: https://github.com/librespot-org/librespot/blob/master/COMPILING.md
Might need to install Rust if you didn't have it already. Make sure you select the right backend, in my case had to specify alsa using: cargo build --no-default-features --features "alsa-backend"
After running the librespot --cache <YOUR_CONFIGURATION_PATH> -j
command on the Pi, I noted the listener port number
Then copied the full output URL on to a laptop browser, which had port-forwarding setup via ssh to point back to the Raspberry Pi IP address and port.
That then authenticated to Spotify on the laptop browser (needed to enter Spotify username/password), which sent the authentication response back to the Raspberry Pi (via port-forwarding), writing the authentication token to the path specified when running librespot with the -j option
Changed /lib/systemd/system/raspotify.service
as advised above to specify
[Service]
DynamicUser=no
Then run systemctl daemon-reload && systemctl restart raspotify
.
After this, noticed below new lines in the librespot logs: Found pre-existing private CacheDirectory= directory /var/cache/private/raspotify, migrating to /var/cache/raspotify. Apparently, service previously had DynamicUser= turned on, and has now turned it off.
Was also still seeing the Bad Credentials failure message too at this point, as it was still using username/password
The authentication token was still in the folder specified and the token file is called credentials.json. I copied that now to the cache folder mentioned in the logs: cp credentials.json /var/cache/raspotify/
Updated the raspotify config file sudo vi /etc/raspotify/conf
to comment out below items to enable 0Auth instead of username/password
#LIBRESPOT_DISABLE_CREDENTIAL_CACHE=
#LIBRESPOT_DISABLE_DISCOVERY=
#LIBRESPOT_USERNAME="mysecretusername"
#LIBRESPOT_PASSWORD="mysecretpassword"
Restarted raspotify with systemctl restart raspotify
and everything worked, clean librespot logs no more errors
Great, thanks for detailing the steps!
Here are my thoughts.
More info has been requested. The issue will be closed shortly if it's not provided.
Just wanted to comment that you dont need port forwarding for the OAuth flow. You can copy the callback URL returned by spotify (with a 127.0.0.1 address) and use curl to invoke it from the raspberrypi where you executed "librespot --cache
Raspotify is just a package
Due Diligence
What can we do to make Raspotify more awesome?
As of https://github.com/librespot-org/librespot/issues/1308 and subsequent PR https://github.com/librespot-org/librespot/pull/1309, Spotify has apparently disabled password auth altogether and forces OAuth for everyone. Please add an option to authenticate with OAuth through
librespot
. Upstreamlibrespot
already supports OAuth with-j
option, somehow I can't figure out which cache dir to use to get it working with Raspotify after successful auth.