jesseward / jellyfin-plugin-lastfm

LastFM plugin for the Jellyfin media system. Fork of the Emby Last.FM plug-in
178 stars 11 forks source link

Authentication Failed - You do not have permissions to access this service #51

Closed angiioh closed 1 year ago

angiioh commented 1 year ago

Hi! I recently added this plugin so I can scrobble my music on Jellyfin. However, whenever I try to login, I get the following error: "Authentication Failed - You do not have permissions to access this service" How do I get it to prompt last.fm to allow access?

Thank you

ywaf commented 1 year ago

use username not email

angiioh commented 1 year ago

I never tried my email. In other apps it's always been username so that's all I tried.

monday-j commented 1 year ago

Having the same issue here - I'm running Jellyfin through a privileged Proxmox LXC if that makes a difference

Thinking about it, you could probably edit the .xml file in the Jellyfin Plugin config directory, but unfortunately I don't know the syntax I would use for this to work

jesseward commented 1 year ago

hey @angiioh and @monday-j thanks for reporting this.

Please confirm you're running 8.0.0.3 of the plugin. Your logs will output something similar to the following

[2023-07-03 01:00:03.497 +00:00] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded assembly "Jellyfin.Plugin.Lastfm, Version=8.0.0.3, Culture=neutral, PublicKeyToken=null" from "/config/plugins/LastFM/Jellyfin.Plugin.Lastfm.dll"

Please also provide any logs that include the string Jellyfin.Plugin.Lastfm. These may include additional details about the failure.

angiioh commented 1 year ago

No problem! I am using 8.0.0.3

I found this in the log after clicking 'save' in the plugin settings:

[2023-07-02 21:14:57.215 -06:00] [INF] Fetching LastFM mobilesession auth for Username="angii" [2023-07-02 21:14:57.666 -06:00] [INF] Lost 1 WebSockets. [2023-07-02 21:15:02.288 -06:00] [INF] Fetching LastFM mobilesession auth for Username="angii" [2023-07-02 21:15:02.455 -06:00] [ERR] Authentication Failed - You do not have permissions to access the service [2023-07-02 21:15:02.460 -06:00] [WRN] Slow HTTP Response from "http://127.0.0.1:8096/Lastfm/Login" to "127.0.0.1" in 0:00:05.2558504 with Status Code 200 [2023-07-02 21:15:02.484 -06:00] [ERR] Authentication Failed - You do not have permissions to access the service

jesseward commented 1 year ago

hey @angiioh, The error itself is being returned from the Last.FM API. This is interesting and it seems limited to a subset of accounts as this is not happening to my account (sample size of 1 😮‍💨 ).

I found this comment from @ben-xo who was a longtime developer at last.fm before moving on to a new company. https://github.com/tomahawk-player/tomahawk/issues/435#issuecomment-287779343 . There are a few things that stand out.

can try changing their password on the site (feel free to subsequently change it back again) to resynchronise their auth.getMobileSession authToken. We sometimes find that a user's authToken can get out of sync, due to the fact that it's a bit of a hack, and not really supported any more (it's mainly left in place for owners of hardware devices that cannot get their firmware updated, such as Sonos).

This Jellyfin plugin does use auth.getMobileSession (https://github.com/jesseward/jellyfin-plugin-lastfm/blob/master/Jellyfin.Plugin.Lastfm/Resources/Strings.cs#L15). I wasn't aware this endpoint is deprecated. FWIW their documentation doesn't state as such (https://www.last.fm/api/mobileauth). So I am not (yet) planning to rewrite the auth mechanism.

As a long shot, can you try changing your password on the last.fm site and then swap it back. It sounds like that had previously kicked off a synchronize task. In the event this is a Last.FM account related problem.

monday-j commented 1 year ago

Changing my password worked! Thanks for looking this up for us :)

angiioh commented 1 year ago

Worked for me as well. Thank you!

jesseward commented 1 year ago

Thanks for confirming @angiioh and @monday-j. I have added a note to the known issues section of the README.

Will keep an eye out for reports of this and determine if the auth mechanism should be migrated away from their mobileauth endpoint.