librespot-java icon indicating copy to clipboard operation
librespot-java copied to clipboard

BadAuth when creating session

Open KagChi opened this issue 2 years ago • 29 comments

Describe the bug Somehow I can't login to spotify account, it always throwing BadAuth error, I tried with other account, still same. (im sure the pass i use is valid, tried on web player)

To Reproduce Login as usual

Expected behavior Logged in with provided account

Screenshots/Stracktraces/Logs Screenshot_2022-04-21-18-18-29-07

Version/Commit c3473bda8a70fad209c8525b04c2fd23ccc0d2fa

KagChi avatar Apr 21 '22 11:04 KagChi

Note: this error does not throw when using proxy.

KagChi avatar Apr 21 '22 13:04 KagChi

Is this working for you today?

jpgrovy avatar Apr 22 '22 12:04 jpgrovy

Is this working for you today?

no, is it possible to get IP ban?

KagChi avatar Apr 23 '22 01:04 KagChi

I’m not sure. It’s very frustrating. I really need to fix this 😭

jpgrovy avatar Apr 23 '22 02:04 jpgrovy

I don’t think it’s an ip ban issue. I tried making a whole new deployment on a new server and it’s not working for me.

On Apr 22, 2022, at 9:57 PM, KagChi @.***> wrote:

 Is this working for you today?

no, is it possible to get IP ban?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

jpgrovy avatar Apr 23 '22 02:04 jpgrovy

If it's not shown when using a proxy it must be something related to your IP... Which proxy did you use?

iscle avatar Apr 28 '22 05:04 iscle

i use webshare.io proxy

KagChi avatar Apr 28 '22 10:04 KagChi

Same issue on an android app that I custom-built. Username and passwords are being passed in correctly yet it throws BadCredentials.

bs2kbs2k avatar Apr 30 '22 18:04 bs2kbs2k

@bs2kbs2k @KagChi Can you post the full log please? Set the logLevel to all in the config file first :)

iscle avatar May 07 '22 09:05 iscle

Its was working yesterday. but i think the reason i got blocked is because too many times relogin to that account.

iirc the error is same if you provide wrong creds.

KagChi avatar May 07 '22 11:05 KagChi

@bs2kbs2k @KagChi Can you post the full log please? Set the logLevel to all in the config file first :)

2022-05-07 20:37:15,175 INFO  ApResolver:90 - Loaded aps into pool: {accesspoint=[ap-gae2.spotify.com:4070, ap-gae2.spotify.com:443, ap-gae2.spotify.com:80, ap-gew1.spotify.com:4070, ap-guc3.spotify.com:443], dealer=[gae2-dealer.spotify.com:443, guc3-dealer.spotify.com:443, gew1-dealer.spotify.com:443], spclient=[gae2-spclient.spotify.com:443, guc3-spclient.spotify.com:443, gew1-spclient.spotify.com:443]}
2022-05-07 20:37:15,268 DEBUG TimeProvider:90 - Loaded time offset from NTP: 13ms
2022-05-07 20:37:15,994 INFO  Session:137 - Created new session! {deviceId: 2c89be24c40cc491dd131e3c5f06b98adae0dc40, ap: ap-gew1.spotify.com:4070, proxy: false} 
2022-05-07 20:37:16,831 INFO  Session:331 - Connected successfully!
2022-05-07 20:37:17,342 ERROR Log4JUncaughtExceptionHandler:31 - [main]
xyz.gianlu.librespot.core.Session$SpotifyAuthenticationException: BadCredentials
        at xyz.gianlu.librespot.core.Session.authenticatePartial(Session.java:450) ~[librespot-player-1.6.2.jar:1.6.2]
        at xyz.gianlu.librespot.core.Session.authenticate(Session.java:339) ~[librespot-player-1.6.2.jar:1.6.2]
        at xyz.gianlu.librespot.core.Session.access$600(Session.java:77) ~[librespot-player-1.6.2.jar:1.6.2]
        at xyz.gianlu.librespot.core.Session$Builder.create(Session.java:1029) ~[librespot-player-1.6.2.jar:1.6.2]
        at xyz.gianlu.librespot.player.Main.main(Main.java:80) ~[librespot-player-1.6.2.jar:1.6.2]

bs2kbs2k avatar May 07 '22 11:05 bs2kbs2k

I ripped out everything on my android app so the player log is there

bs2kbs2k avatar May 07 '22 11:05 bs2kbs2k

Has anyone found a fix for Bad Credential error? Works fine running locally but doesnt work when hosted on Heroku for example.

jpgrovy avatar Dec 04 '22 21:12 jpgrovy

Use proxy for temp fix

KagChi avatar Dec 05 '22 03:12 KagChi

Do you have an example how to do this on Heroku ?

On Dec 4, 2022, at 10:48 PM, KagChi @.***> wrote:

 Use proxy for temp fix

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

jpgrovy avatar Dec 05 '22 04:12 jpgrovy

Wdym? just configure your session conf

KagChi avatar Dec 05 '22 10:12 KagChi

I'm getting the same error with a SOCKS proxy, is that what you meant?

arch-btw avatar Dec 06 '22 17:12 arch-btw

I wasn’t using any proxies and didn’t have any problems for 6+ months. Now all of a sudden I get Bad Credentials error

On Dec 6, 2022, at 12:49 PM, arch-btw @.***> wrote:

 I'm getting the same error with a SOCKS proxy, is that what you meant?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

jpgrovy avatar Dec 06 '22 17:12 jpgrovy

image

Looks like proxy isnt working now, still got bad authorizations.

KagChi avatar Dec 09 '22 15:12 KagChi

@Iscle https://hastebin.de/ozejeniwiw.apache here is the full stackrace, please investigate out

KagChi avatar Dec 09 '22 15:12 KagChi

image

Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

jpgrovy avatar Dec 09 '22 15:12 jpgrovy

image Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

KagChi avatar Dec 10 '22 04:12 KagChi

image Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

You can’t even log in locally ?

jpgrovy avatar Dec 10 '22 05:12 jpgrovy

image Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

You can’t even log in locally ?

I mean, i can log in with same proxy or without proxy. so i suppose the proxy has no effect rn

KagChi avatar Dec 10 '22 12:12 KagChi

The “Bad Credentials” error is gone ?

On Dec 10, 2022, at 7:47 AM, KagChi @.***> wrote:



Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

You can’t even log in locally ?

I mean, i can log in with same proxy or without proxy. so i suppose the proxy has no effect rn

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

jpgrovy avatar Dec 10 '22 16:12 jpgrovy

It doesnt throw the error on my local pc, but it does throw the error on my vps

On Sat, Dec 10, 2022, 23:11 jpgrovy @.***> wrote:

The “Bad Credentials” error is gone ?

On Dec 10, 2022, at 7:47 AM, KagChi @.***> wrote:



Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

You can’t even log in locally ?

I mean, i can log in with same proxy or without proxy. so i suppose the proxy has no effect rn

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot-java/issues/488#issuecomment-1345296817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFDZ34XL4EGJL2OWQZ2Y43WMSTTNANCNFSM5T65LQLA . You are receiving this because you were mentioned.Message ID: @.***>

KagChi avatar Dec 10 '22 16:12 KagChi

Ok.. so same problem then. And you’ve tried good proxies on your vps? Spotify started blocking all vps provider ip’s.

On Dec 10, 2022, at 11:34 AM, KagChi @.***> wrote:

 It doesnt throw the error on my local pc, but it does throw the error on my vps

On Sat, Dec 10, 2022, 23:11 jpgrovy @.***> wrote:

The “Bad Credentials” error is gone ?

On Dec 10, 2022, at 7:47 AM, KagChi @.***> wrote:



Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

You can’t even log in locally ?

I mean, i can log in with same proxy or without proxy. so i suppose the proxy has no effect rn

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot-java/issues/488#issuecomment-1345296817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFDZ34XL4EGJL2OWQZ2Y43WMSTTNANCNFSM5T65LQLA . You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

jpgrovy avatar Dec 10 '22 16:12 jpgrovy

I already said, proxy has no effect. the proxy only proxy http request. i dont think we login to Spotify only using their http. pretty sure they have ws

On Sat, Dec 10, 2022, 23:40 jpgrovy @.***> wrote:

Ok.. so same problem then. And you’ve tried good proxies on your vps? Spotify started blocking all vps provider ip’s.

On Dec 10, 2022, at 11:34 AM, KagChi @.***> wrote:

 It doesnt throw the error on my local pc, but it does throw the error on my vps

On Sat, Dec 10, 2022, 23:11 jpgrovy @.***> wrote:

The “Bad Credentials” error is gone ?

On Dec 10, 2022, at 7:47 AM, KagChi @.***> wrote:



Looks like proxy isnt working now, still got bad authorizations.

They made a lot of changes yesterday. They are blocking IP’s now of data centers. They have done this in the past and then reversed it. Proxies must be good residential proxies for sure to work.

Proxy has no effect this time, tested on my local it works neither proxied nor doesnt

You can’t even log in locally ?

I mean, i can log in with same proxy or without proxy. so i suppose the proxy has no effect rn

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

— Reply to this email directly, view it on GitHub < https://github.com/librespot-org/librespot-java/issues/488#issuecomment-1345296817 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AOFDZ34XL4EGJL2OWQZ2Y43WMSTTNANCNFSM5T65LQLA

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

— Reply to this email directly, view it on GitHub https://github.com/librespot-org/librespot-java/issues/488#issuecomment-1345302744, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOFDZ34EJYBIUI2RKZZAH5DWMSXBJANCNFSM5T65LQLA . You are receiving this because you were mentioned.Message ID: @.***>

KagChi avatar Dec 11 '22 04:12 KagChi

I found a workaround for this issue.

Steps.

  1. Log in locally following the suggested way.
  2. Copy the credentials.json from local to VPS.
  3. On VPS, log in using stored credentials.
  4. Voila. 🎉

leon-sleepinglion avatar Dec 28 '22 09:12 leon-sleepinglion