tehkillerbee / mopidy-tidal

Tidal Backend plugin for Mopidy
Apache License 2.0
93 stars 28 forks source link

PKCE #155

Closed fmarzocca closed 7 months ago

fmarzocca commented 7 months ago

Do you have a sort of how-to to use the new PKCE authentication for HiRes quality?

tehkillerbee commented 7 months ago

Yes, it's all outlined in the readme. You'll need to set auth_mode and the port to use for the webserver used for the authentication. Eg.:

auth_method = PKCE
login_server_port = 8989

For the login procedure, this is described here: https://github.com/tehkillerbee/mopidy-tidal?tab=readme-ov-file#pkce-flow

Let me know if it is not clear what to do, then I'll update the readme.

fmarzocca commented 7 months ago

Will try, thanks!

fmarzocca commented 7 months ago

Upon restart, I got this in my log:


2024-03-02 14:54:03,852 INFO [2113:TidalBackend-3 (_actor_loop)] mopidy_tidal.backend: Quality: HI_RES_LOSSLESS
2024-03-02 14:54:03,864 INFO [2113:TidalBackend-3 (_actor_loop)] mopidy_tidal.backend: Authentication: PKCE
2024-03-02 14:54:03,870 WARNING [2113:TidalBackend-3 (_actor_loop)] mopidy_tidal.backend: AUTO login implies lazy connection, setting lazy=True.
2024-03-02 14:54:03,872 INFO [2113:TidalBackend-3 (_actor_loop)] mopidy_tidal.backend: Login method: AUTO
2024-03-02 14:54:03,885 INFO [2113:TidalBackend-3 (_actor_loop)] mopidy_tidal.backend: Using default client id & client secret from python-tidal

and this is my config:

[tidal]
enabled = true
quality = HI_RES_LOSSLESS
auth_method = PKCE
login_server_port = 8989
#client_id =
#client_secret =

I am running mopidy on an headless server. How can I visit http://localhost:8989 ??

tehkillerbee commented 7 months ago

I am running mopidy on an headless server.

Yes, I do the same.

This is not clear from the instructions. If you are using a headless server, you should replace local host with the IP address of your device. Eg. 192.168.0.10:8989.

fmarzocca commented 7 months ago

If you are using a headless server, you should replace local host with the IP address of your device. Eg. 192.168.0.10:8989.

not working anyway...

fmarzocca commented 7 months ago

I finally got it! The authentication procedure is quite tricky...

tehkillerbee commented 7 months ago

What IP address are you using to access your server?

Since you are using lazy browsing enabled , you'd need to browse the tidal folder structure before the login server is triggered.

Edit: Great! Sounds like the instructions could do with an improvement 😂

fmarzocca commented 7 months ago

I didn't read the General login tips. Maybe just add a note in the instructions: Please read here

fmarzocca commented 7 months ago

I did not have any "lazy" setting so I assumed it was false (default). But the logs reported:

2024-03-02 14:54:03,870 WARNING [2113:TidalBackend-3 (_actor_loop)] mopidy_tidal.backend: AUTO login implies lazy connection, setting lazy=True

tehkillerbee commented 7 months ago

Added more details to documentation in v0.3.6