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

Failed To Get Access Token - OAuth Account #95

Open
jasonlaguidice opened this issue Oct 2, 2023 · 2 comments
Open

Failed To Get Access Token - OAuth Account #95

jasonlaguidice opened this issue Oct 2, 2023 · 2 comments

Comments

@jasonlaguidice
Copy link

I'm having issues getting this setup and working with a Spotify account that exists with OAuth (Facebook) only. Adding the account only gives errors in the log about failed to get access token. I am using my own Client ID and have added the account e-mail address to the authorized users list just in case. debug.spotty doesn't reveal very much useful information so here's a log file for info.spotty for starting account add, adding the account, then trying to play on a connected speaker.

No sound plays from the speaker. Hopefully I captured the useful part of the log in attempting.

For what it's worth if I add an account that has a standard non-OAuth login it works and plays just fine.

[23-10-02 03:34:14.0746] Plugins::Spotty::AccountHelper::renameCacheFolder (147) Trying to rename __AUTHENTICATE__ to 
[23-10-02 03:34:14.0748] Plugins::Spotty::AccountHelper::renameCacheFolder (149) Error: No newId found in '__AUTHENTICATE__'
[23-10-02 03:34:14.0751] Plugins::Spotty::AccountHelper::renameCacheFolder (149) Backtrace:

   frame 0: Slim::Utils::Log::logBacktrace (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/AccountHelper.pm line 149)
   frame 1: Plugins::Spotty::AccountHelper::renameCacheFolder (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Settings/Auth.pm line 187)
   frame 2: Plugins::Spotty::Settings::Auth::cleanup (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Settings.pm line 61)
   frame 3: Plugins::Spotty::Settings::handler (/usr/share/perl5/Slim/Web/HTTP.pm line 1168)
   frame 4: Slim::Web::HTTP::generateHTTPResponse (/usr/share/perl5/Slim/Web/HTTP.pm line 933)
   frame 5: Slim::Web::HTTP::processURL (/usr/share/perl5/Slim/Web/HTTP.pm line 728)
   frame 6: Slim::Web::HTTP::processHTTP (/usr/share/perl5/Slim/Networking/IO/Select.pm line 122)
   frame 7: (eval) (/usr/share/perl5/Slim/Networking/IO/Select.pm line 118)
   frame 8: Slim::Networking::IO::Select::__ANON__ (/usr/share/perl5/Slim/Networking/IO/Select.pm line 167)
   frame 9: (eval) (/usr/share/perl5/Slim/Networking/IO/Select.pm line 167)
   frame 10: Slim::Networking::IO::Select::loop (/usr/sbin/squeezeboxserver line 721)
   frame 11: main::idle (/usr/sbin/squeezeboxserver line 671)
   frame 12: main::main (/usr/sbin/squeezeboxserver line 1210)

[23-10-02 03:34:14.0970] Plugins::Spotty::Settings::Auth::startHelper (163) Starting Spotty Connect deamon: 
/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64 -c /var/lib/squeezeboxserver/cache/spotty/__AUTHENTICATE__ -n Spotify Authorization (LogitechMediaServer) -a --ap-port=12321
[23-10-02 03:34:14.1157] Plugins::Spotty::Helper::_findBin (192) Trying helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty
[23-10-02 03:34:14.1285] Plugins::Spotty::Helper::_findBin (195) Found helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty
[23-10-02 03:34:14.1293] Plugins::Spotty::Helper::_findBin (192) Trying helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64
[23-10-02 03:34:14.1470] Plugins::Spotty::Helper::_findBin (195) Found helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64
[23-10-02 03:34:20.2351] Plugins::Spotty::Settings::Auth::startHelper (163) Starting Spotty Connect deamon: 
/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64 -c /var/lib/squeezeboxserver/cache/spotty/__AUTHENTICATE__ -n Spotify Authorization (LogitechMediaServer) -a --ap-port=12321
[23-10-02 03:34:20.3020] Plugins::Spotty::AccountHelper::renameCacheFolder (147) Trying to rename __AUTHENTICATE__ to 4ae5341d
[23-10-02 03:34:20.3031] Plugins::Spotty::Settings::Auth::shutdownHelper (193) Quitting authentication daemon
[23-10-02 03:34:20.3039] Plugins::Spotty::AccountHelper::renameCacheFolder (147) Trying to rename __AUTHENTICATE__ to 
[23-10-02 03:34:20.3041] Plugins::Spotty::AccountHelper::renameCacheFolder (149) Error: No newId found in '__AUTHENTICATE__'
[23-10-02 03:34:20.3044] Plugins::Spotty::AccountHelper::renameCacheFolder (149) Backtrace:

   frame 0: Slim::Utils::Log::logBacktrace (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/AccountHelper.pm line 149)
   frame 1: Plugins::Spotty::AccountHelper::renameCacheFolder (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Settings/Auth.pm line 187)
   frame 2: Plugins::Spotty::Settings::Auth::cleanup (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Settings/Auth.pm line 197)
   frame 3: Plugins::Spotty::Settings::Auth::shutdownHelper (/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Settings.pm line 143)
   frame 4: Plugins::Spotty::Settings::handler (/usr/share/perl5/Slim/Web/HTTP.pm line 1168)
   frame 5: Slim::Web::HTTP::generateHTTPResponse (/usr/share/perl5/Slim/Web/HTTP.pm line 933)
   frame 6: Slim::Web::HTTP::processURL (/usr/share/perl5/Slim/Web/HTTP.pm line 728)
   frame 7: Slim::Web::HTTP::processHTTP (/usr/share/perl5/Slim/Networking/IO/Select.pm line 122)
   frame 8: (eval) (/usr/share/perl5/Slim/Networking/IO/Select.pm line 118)
   frame 9: Slim::Networking::IO::Select::__ANON__ (/usr/share/perl5/Slim/Networking/IO/Select.pm line 167)
   frame 10: (eval) (/usr/share/perl5/Slim/Networking/IO/Select.pm line 167)
   frame 11: Slim::Networking::IO::Select::loop (/usr/sbin/squeezeboxserver line 721)
   frame 12: main::idle (/usr/sbin/squeezeboxserver line 671)
   frame 13: main::main (/usr/sbin/squeezeboxserver line 1210)

[23-10-02 03:34:20.3071] Plugins::Spotty::Helper::_findBin (192) Trying helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty
[23-10-02 03:34:20.3187] Plugins::Spotty::Helper::_findBin (195) Found helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty
[23-10-02 03:34:20.3193] Plugins::Spotty::Helper::_findBin (192) Trying helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64
[23-10-02 03:34:20.3310] Plugins::Spotty::Helper::_findBin (195) Found helper application: /var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64
[23-10-02 03:34:25.3397] Plugins::Spotty::Connect::_connectEvent (371) Got called from spotty helper for bb:bb:f5:21:c7:38: volume
[23-10-02 03:34:25.3408] Plugins::Spotty::API::Token::get (226) Didn't find cached token. Need to refresh.
[23-10-02 03:34:25.3448] Plugins::Spotty::API::Token::_logCommand (155) Trying to get access token: "/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64" -n "Squeezebox" -c "/var/lib/squeezeboxserver/cache/spotty/bbbbf521c738" -i "2873973689114606ab027241391b10fd" --disable-discovery --scope "user-read-private,user-follow-modify,user-follow-read,user-library-read,user-library-modify,user-top-read,user-read-recently-played,user-read-playback-state,user-modify-playback-state,playlist-read-private,playlist-read-collaborative,playlist-modify-public,playlist-modify-private" --save-token "/tmp/spt-GaQH4glU"
[23-10-02 03:34:25.3516] Plugins::Spotty::Connect::_connectEvent (388) Ignoring volume reset to 49
[23-10-02 03:34:25.8764] Plugins::Spotty::Connect::_connectEvent (371) Got called from spotty helper for bb:bb:f5:21:c7:38: start
[23-10-02 03:34:25.8775] Plugins::Spotty::API::Token::get (226) Didn't find cached token. Need to refresh.
[23-10-02 03:34:25.8788] Plugins::Spotty::API::Token::_logCommand (155) Trying to get access token: "/var/lib/squeezeboxserver/cache/InstalledPlugins/Plugins/Spotty/Bin/i386-linux/spotty-x86_64" -n "Squeezebox" -c "/var/lib/squeezeboxserver/cache/spotty/bbbbf521c738" -i "2873973689114606ab027241391b10fd" --disable-discovery --scope "user-read-private,user-follow-modify,user-follow-read,user-library-read,user-library-modify,user-top-read,user-read-recently-played,user-read-playback-state,user-modify-playback-state,playlist-read-private,playlist-read-collaborative,playlist-modify-public,playlist-modify-private" --save-token "/tmp/spt-GHgMlzC1"
[23-10-02 03:34:25.8868] Plugins::Spotty::API::Token::get (226) Didn't find cached token. Need to refresh.
[23-10-02 03:34:26.3520] Plugins::Spotty::API::Token::_gotTokenInfo (168) Got response: {"error":"Failed to get access token."}
[23-10-02 03:34:26.3523] Plugins::Spotty::API::Token::_gotTokenInfo (187) Failed to get access token.
[23-10-02 03:34:26.8856] Plugins::Spotty::API::Token::_gotTokenInfo (168) Got response: {"error":"Failed to get access token."}
[23-10-02 03:34:26.8859] Plugins::Spotty::API::Token::_gotTokenInfo (187) Failed to get access token.
[23-10-02 03:34:26.8871] Plugins::Spotty::Connect::__ANON__ (413) Current Connect state: 
(
  { name => "Failed to get access token", progress => 0, type => "text" },
  "start",
)
[23-10-02 03:34:26.8874] Plugins::Spotty::Connect::__ANON__ (434) Unknown command called? start
{ name => "Failed to get access token", progress => 0, type => "text" }
[23-10-02 03:34:26.9837] Plugins::Spotty::Connect::_connectEvent (371) Got called from spotty helper for bb:bb:f5:21:c7:38: change
[23-10-02 03:34:26.9849] Plugins::Spotty::API::Token::get (222) Found cached token: -1
[23-10-02 03:34:26.9855] Plugins::Spotty::API::Token::get (222) Found cached token: -1
[23-10-02 03:34:26.9861] Plugins::Spotty::Connect::__ANON__ (413) Current Connect state: 
(
  { name => "Failed to get access token", progress => 0, type => "text" },
  "change",
)
[23-10-02 03:34:30.5370] Plugins::Spotty::Connect::_connectEvent (371) Got called from spotty helper for bb:bb:f5:21:c7:38: stop
[23-10-02 03:34:30.5380] Plugins::Spotty::API::Token::get (222) Found cached token: -1
[23-10-02 03:34:30.5384] Plugins::Spotty::API::Token::get (222) Found cached token: -1
[23-10-02 03:34:30.5389] Plugins::Spotty::Connect::__ANON__ (413) Current Connect state: 
(
  { name => "Failed to get access token", progress => 0, type => "text" },
  "stop",
)
[23-10-02 03:34:30.5392] Plugins::Spotty::Connect::__ANON__ (434) Unknown command called? stop
{ name => "Failed to get access token", progress => 0, type => "text" }
[23-10-02 03:34:43.0077] Plugins::Spotty::Connect::DaemonManager::initHelpers (92) Checking Spotty Connect helper daemons...
[23-10-02 03:34:43.0080] Plugins::Spotty::Connect::DaemonManager::initHelpers (122) This is the sync group's master, or a standalone player with Spotify Connect enabled: bb:bb:f5:21:c7:38
@michaelherger
Copy link
Owner

I assume you tried to authenticate Spotty using a Spotify app, rather than entering credentials in the Spotty settings?

In case you had multiple accounts: would you mind removing them all, and then try to add just that one?

This is not a problem I've seen before, I think. But searching around the internet I found we're in good company: I found several references to the same problem on Tesla 😂. Here's a suggestion which might work: create a device password and try to use that in Spotty directly? See eg. https://community.spotify.com/t5/Accounts/Cannot-sign-in-with-my-Facebook-generated-username-in-my-Tesla/m-p/4905251#M1525808

@jasonlaguidice
Copy link
Author

I assume you tried to authenticate Spotty using a Spotify app, rather than entering credentials in the Spotty settings?

Yup, for the OAuth account I tried via desktop app and an android device. For the non-OAuth account it was tested with an iPhone. I don't actually have a password for the account because it was an OAuth only.

In case you had multiple accounts: would you mind removing them all, and then try to add just that one?

It stops working entirely once the OAuth account is added, interestingly enough... but works up to that point if the other account is the only one added. If the OAuth account is on there by itself or with the working account it dies.

This is not a problem I've seen before, I think. But searching around the internet I found we're in good company: I found several references to the same problem on Tesla 😂. Here's a suggestion which might work: create a device password and try to use that in Spotty directly? See eg. https://community.spotify.com/t5/Accounts/Cannot-sign-in-with-my-Facebook-generated-username-in-my-Tesla/m-p/4905251#M1525808

Setting a device password will probably be the answer! And in digging around a little more it looks like at some point since I last checked (6-7 months ago) I can add a normal password to the account and remove the Facebook OAuth link anyway, hooray! No more having to reactivate my stupid Facebook account to sign back into Spotify if I ever needed to.

I'll test with an app password and report back before unlinking.

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

2 participants