music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.3k stars 48 forks source link

Cannot communicate with Nextcloud Music through subsonic API #1856

Closed perillamint closed 6 months ago

perillamint commented 7 months ago

What version of Music Assistant has the issue?

2024.1.0

The problem

Nextcloud Music plugin provides subsonic API, but Music Assistant cannot communicate with it because Nextcloud does not provide Subsonic MD5 token-based authentication. (it seems they decided to use SHA-256 to store the token instead of MD5, which is broken decades ago. Also, TLS being omnipresent in these days, so "legacy" authentication is no longer a security risk anyway)

How to reproduce

  1. Set up the Nextcloud instance with the music plugin.
  2. In Nextcloud Music settings, create a new subsonic credential.
  3. Attempt to use that credential on Music Assistant Subsonic Music provider
  4. Watch it fail with the "Token authentication not supported" error message.

Relevant log output

No response

Additional information

Exposing configuration UI to set value passed to legacyAuth=[bool] https://github.com/khers/py-opensonic/blob/master/src/libopensonic/connection.py#46 to user interface will solve the problem.

Relevant codes: https://github.com/music-assistant/server/blob/main/music_assistant/server/providers/opensubsonic/sonic_provider.py#L72

What version of Home Assistant Core are your running

2024.1.5

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

OzGav commented 7 months ago

@khers

OzGav commented 6 months ago

Fixed in beta93. Thanks for the PR

khers commented 6 months ago

EDIT: Please open a new issue for this instead of adding on to one that is closed.

perillamint commented 6 months ago

Note that Nextcloud/Owncloud Music album fetch issue:

You NEED to apply this patch on your Nextcloud/Owncloud Music app: https://github.com/owncloud/music/pull/1125

This is NOT a Music Assistant bug, but Owncloud Music app bug. Wait for the next release of Owncloud Music or patch it by yourself. (Sorry, I missed their merge window for that patch, so you will have to wait or patch it by yourself)

(Leaving note for the reference)

perillamint commented 4 months ago

Additional update: If you are experiencing above issue, Check your Music app is updated to v1.11.0

https://github.com/owncloud/music/issues/1123#issuecomment-2068189724