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 Refresh Account #163

Open
garv-shah opened this issue Jan 16, 2023 · 15 comments
Open

Failed to Refresh Account #163

garv-shah opened this issue Jan 16, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@garv-shah
Copy link

Sometimes if you've been playing for a while it will fail to refresh your Minecraft account, a temporary fix could be to add a logout option but probably better to find a more reliable way to refresh accounts :D

@garv-shah garv-shah added the bug Something isn't working label Jan 16, 2023
@garv-shah
Copy link
Author

oh nevermind seems you can already logout on the linux branch, are there any issues that prevent refreshing the accounts?

@stackotter
Copy link
Owner

@JWhitmore1 is also getting this issue, and I've gotten it occasionally. Still not really sure what causes it to happen. It's likely related to the login system not really being synchronised so maybe if two refreshes happen at once it breaks? How often does this happen for you?

@garv-shah
Copy link
Author

happened twice so far, a quick logout seemed to fix it
perhaps a launcher like multimc or prism has had a similar issue before? not sure, but I could do some digging

@stackotter
Copy link
Owner

I think the best course of action would be for me to add a bunch of debugging logs to investigate potential causes. That way when it happens again the person who it happened to can hopefully send me some logs. I really need to implement a proper log file system...

@garv-shah
Copy link
Author

oh yeah, for sure that’s probably better! proper logging would be great especially for fixing bugs like this :)

@stackotter
Copy link
Owner

I'll try and get a file logging system working today 🤞

@stackotter
Copy link
Owner

stackotter commented Jan 17, 2023

It looks like I did already add some logging in the past, and I just ran into this issue as well. Here's the error returned from the Microsoft API:

{
  "error": "invalid_scope",
  "error_description": "AADSTS70011: The provided value for the input parameter 'scope' has not been pre-authorized for this client application.\r\nTrace ID: 492b2dc9-fc89-4897-9bc2-f6a38ec71c00\r\nCorrelation
 ID: 0185fd6b-02ef-45d6-a3dc-dd27935a91be\r\nTimestamp: 2023-01-17 04:02:14Z",
  "error_codes": [70011],
  "timestamp": "2023-01-17 04:02:14Z",
  "trace_id": "492b2dc9-fc89-4897-9bc2-f6a38ec71c00",
  "correlation_id": "0185fd6b-02ef-45d6-a3dc-dd27935a91be"
}

This is the scope that it's referring to in the error: service::user.auth.xboxlive.com::MBI_SSL.

Not exactly sure what this means yet

@stackotter
Copy link
Owner

I've implemented log files now 🎉 and you can even use the View > Logs menu item to view the logs live in the built-in macOS Console app

@garv-shah
Copy link
Author

nice!

@garv-shah garv-shah changed the title Failed to Refresh Account, Possible Logout Option? Failed to Refresh Account Jan 18, 2023
@garv-shah
Copy link
Author

garv-shah commented Jan 18, 2023

Had the issue again, the logs reported the following:

[2023-01-18T12:51:33.977+11:00] [DeltaClient] [WARNING] LAN server enumeration failed: failedToReadFromSocket(DeltaCore.SocketError.disconnected)
[2023-01-18T12:51:35.170+11:00] [DeltaCore] [DEBUG] {"error":"invalid_scope","error_description":"AADSTS70011: The provided value for the input parameter 'scope' has not been pre-authorized for this client application.\r\nTrace ID: 3da2aba8-eab5-4749-8c6f-2bc71cd03400\r\nCorrelation ID: 0b445333-39c0-43d5-82d1-ff01d51b7f28\r\nTimestamp: 2023-01-18 01:51:35Z","error_codes":[70011],"timestamp":"2023-01-18 01:51:35Z","trace_id":"3da2aba8-eab5-4749-8c6f-2bc71cd03400","correlation_id":"0b445333-39c0-43d5-82d1-ff01d51b7f28"}
[2023-01-18T12:51:35.172+11:00] [DeltaClient] [ERROR] Failed to refresh account 'gorbs': accountRefreshFailed(DeltaCore.RequestError.unsuccessfulRequest(400))

so basically the same as what you find before D:

@stackotter
Copy link
Owner

This seems to happen consistently whenever delta client attempts to refresh the user's Microsoft account. I tried changing the scope in the refresh request to match the scope we use in the initial authentication request, but to no avail. Might be worth looking at around at a few other Minecraft authentication implementations to see what they do (e.g. bixilon's Minosoft).

@Bixilon
Copy link

Bixilon commented May 29, 2024 via email

@stackotter
Copy link
Owner

Yeah, I know that it's meant to work 😅

What do you mean by refresh tokens at every stage? As in there are refresh tokens for every single step of the authentication (which would be a bit weird) or there are refresh tokens every time that you make a request (pretty sure that delta client should be handling those fine but worth double checking).

Just left the above comment in case anyone looks into it, cause I'm not looking into it at the moment; working on block breaking and inventory stuff.

@Bixilon
Copy link

Bixilon commented May 30, 2024 via email

@stackotter
Copy link
Owner

stackotter commented Jun 5, 2024

Hm yeah makes sense, I vaguely remember you saying something like that, perhaps we've already talked about the exact same issue on a call one time lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants