Sandertv / gophertunnel

General purpose library for Minecraft Bedrock Edition software written in Go
MIT License
423 stars 96 forks source link

Xbox live login fails #14

Closed gioiann closed 5 years ago

gioiann commented 5 years ago

panic: error obtaining Live token: error decoding flowtoken XML container: EOF

This error started happening really often, then it went away and now it seems like it happens everytime.

I tried with different accounts and also different IPs in case Microsoft blocked my IP because of suspicious login attempts. I also tried creating a new account using a new residential IP and then use the same IP to login with gophertunnel API, it's not working, same error but I'm able to login using minecraft

Sandertv commented 5 years ago

Had some reports of this. Probably some Microsoft account login changes. I'll fix it when I get the time.

gioiann commented 5 years ago

I would like to help but there are is no documentation from Microsoft about the Minecraft login flow. I tried using an https proxy but apparently Minecraft doesn't trust the proxy CA. How did you do it?

Sandertv commented 5 years ago

There's some libraries in other languages that implement Microsoft account logins: Looking into those would be worth it.

gioiann commented 5 years ago

Can you give me an hint about where to start? Like, what libraries are you talking about? I don't think there is a library implementing LoginPacket signing. The only way would be reverse engineering Minecraft or an https proxy

Sandertv commented 5 years ago

The only thing that needs to be done is to login to a Live/Microsoft account and obtain an access token and a refresh token. The rest will still function just fine. Basically, the code in auth/live.go needs to be replaced.

Sandertv commented 5 years ago

This part has nothing to do with Minecraft yet.

gioiann commented 5 years ago

I found the problem: parseJSObject() doesn't properly parse the data. There are closing curly brackets before the end of the object properties.

gioiann commented 5 years ago

Not only that, there are different things wrong with parseJSObject() like:

Sandertv commented 5 years ago

The parseJSObject is a terrible hack that was only there as some kind of hack. The login sequence in live.go is quite the hack.

gioiann commented 5 years ago

Should I open a PR ?

Sandertv commented 5 years ago

Please feel free!