JohnnyCrazy / SpotifyAPI-NET

:sound: A Client for the Spotify Web API, written in C#/.NET
http://johnnycrazy.github.io/SpotifyAPI-NET/
MIT License
1.5k stars 305 forks source link

Invalid OAuth token? #77

Closed gusper closed 8 years ago

gusper commented 8 years ago

Starting yesterday, I noticed my app wasn't getting track information anymore. When I debugged my app, I saw that Track from a GetStatus was null. Tried it with the sample app and noticed I was getting the following response when calling SpotifyAPI.Local.RemoteHandler.GetNewStatus():

"[ {\n\"error\": {\n \"type\": \"4102\", \n \"message\": \"Invalid OAuth token\"\n}, \n\"version\": 9, \n\"client_version\": \"1.0.25.127.g58007b4c\", \n\"running\": true\n} ]"

Anyone else seeing something similar? Wondering if it's something just on my side.

JohnnyCrazy commented 8 years ago

Did you try restarting both, the spotify client and the web helper? I came across a similiar problem but a restart fixed it.

gusper commented 8 years ago

Yep, tried that. Also tried rebooting. Even tried it on a different computer on a different network and still got the same result. Will keep investigating when I get a little more time though.

gusper commented 8 years ago

I've spent some more time trying to debug and no luck. I keep getting the same errors. Next thing I'll try is with a different user account to see if it's somehow specific to my Spotify account. If anyone has any ideas, I'm all ears. @JohnnyCrazy, would you prefer I close this issue or leave it open in case anyone else runs into it or I end up figuring it out?

JimmyAppelt commented 8 years ago

@gusper if its not fixed or doesn't have any explanation, you should leave it open :wink:

Sadly enough i'm unable to do tests myself with the local player since my antivirus blocks connection.

JohnnyCrazy commented 8 years ago

@gusper We can leave it open I guess

Sadly, I can't reproduce it. Could you give me the values of csfr-token and oauth-token? They should be both inside the RemoteHandler Query Method.

JohnnyCrazy commented 8 years ago

Appendix: Instead of writing the values, you can also just confirm they look like regular tokens :smile:

gusper commented 8 years ago

Here's what they look like: OauthKey: "NAowChgKB1Nwb3RpZnkSABoGmBAByAEBJeIG9VYSFA6cvYavFSCObbTOWg1HHR2vks5E" CfidKey: "09e93d471595dd0564aff816cfef58aa" If you want the exact values, I can email them to you. Do they look as you'd expect?

gusper commented 8 years ago

Well, somewhat good news I guess. Both of the machines I was experiencing the problems on (which were on entirely different networks) all of a sudden started working again today. The OauthKey looks like it's different than I had previous while the CfidKey is the same I had.

Going to go ahead and close this out now. Let me know if you have any questions though that I could help answer...

JohnnyCrazy commented 8 years ago

@gusper Are the OAuth tokens both of the same "structure"? Like same length etc.?

gusper commented 8 years ago

Yes. Actually, parts of it are exactly the same (e.g., the beginning of the token) while other parts are completely different.

JohnnyCrazy commented 8 years ago

Mh, then it's probably not the oauth tokens... Maybe it's just the mood of the spotify player :wink:

gusper commented 8 years ago

Will try to be nicer to it going forward now that I know it's a little sensitive. :)

Thanks for the help!