Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching to and Using Open Authorization (OAuth). #79

Open
doris1347 opened this issue Jan 1, 2025 · 0 comments
Open

Switching to and Using Open Authorization (OAuth). #79

doris1347 opened this issue Jan 1, 2025 · 0 comments

Comments

@doris1347
Copy link
Collaborator

doris1347 commented Jan 1, 2025

pi@sPoT:~$

Okay, a quick note for users who are feeling confused about this:
FYI dtcooper/raspotify#675

OAuth: Authorization

Password login has been deprecated and is no longer supported. Instead, OAuth Authorization must be used. Follow the steps below at START HERE to authenticate using OAuth:

To use Midori browser under vnc comment out #python3 spotifypod.py in sudo nano /etc/xdg/openbox/autostart
and save and reboot ...right click on the black openbox screen then open web browser (will take a while to load) Open the provided URL to complete the login process, you should see a hyperlink that says login to spotify, click it, you will be redirected to spotify login, just login and accept the terms then:-

[INFO librespot_oauth] OAuth server listening on 127.0.0.1:5588

The authentication token will be in the folder YOUR_CONFIGURATION_PATH called credentials.json. I copied that now to the raspotify folder cp credentials.json /var/cache/raspotify/

Updated the raspotify config file sudo nano /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,

In sudo nano /etc/xdg/openbox/autostart un-comment python3 spotifypod.py save and reboot.

Good Luck.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Dec 31 00:07:16 2024

START HERE:

Password login has been deprecated and is no longer supported. Instead, OAuth Authorization must be used. Follow the steps below to authenticate using OAuth:

#Run the following command to initiate the OAuth process:

librespot --cache /var/cache/raspotify -j

Open the provided URL in a web browser (Midori) to complete the login process

Press Ctrl-C to quit. [2024-12-31T05:17:30Z INFO librespot] Gracefully shutting down.

pi@sPoT:$ cd /var/cache/raspotify/
-bash: cd: /var/cache/raspotify: Permission denied
pi@sPoT:$ sudo chmod -R a+rwX /var/cache/raspotify To obtain read/write permission to /var/cache/raspotify directory.

pi@sPoT:$ cd /var/cache/raspotify
pi@sPoT:/var/cache/raspotify$ ls -a
. .. credentials.json files volume
pi@sPoT:/var/cache/raspotify$ cd
pi@sPoT:$ systemctl daemon-reload && systemctl restart raspotify

==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: ,,, (pi)
Password:
==== AUTHENTICATION COMPLETE ===
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to restart 'raspotify.service'.
Authenticating as: ,,, (pi)
Password:

Update: the raspotify config file sudo nano /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"

sudo reboot

note: However you may still need to select the device from the spotify-connect list (if you didn't do OAuth (Open Authorization) with your computer/phone first you may have to refresh the Spotify-Connect list a few times to be able to see your "sPoT" device on the list of available devices - you can close immediately after otherwise you will receive "error no devices".

pi@sPoT:~$

@doris1347 doris1347 changed the title Switching to and Using Open Authentication (OAuth). Switching to and Using Open authorization (OAuth). Jan 8, 2025
@doris1347 doris1347 changed the title Switching to and Using Open authorization (OAuth). Switching to and Using Open Authorization (OAuth). Jan 8, 2025
@doris1347 doris1347 pinned this issue Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant