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

Update authentication function #32

Open
PretendingToCode opened this issue Aug 23, 2020 · 2 comments
Open

Update authentication function #32

PretendingToCode opened this issue Aug 23, 2020 · 2 comments

Comments

@PretendingToCode
Copy link

Although the current authentication method in place for this library returns a session, it is a game session. Tokens generated from this type of authentication cannot be used with the online API. Instead, use the following format:

https://authserver.mojang.com/authenticate
POST
Header: Content-Type: application/json
Body:
{
"captcha":"string: captcha key",
"captchaSupported":"InvisibleReCAPTCHA",
"password":"user password",
"requestUser":true,
"username":"user email"
}

Where 'captcha' is an invisible ReCAPTCHA key. Assets and POST request data can be found on the minecraft.net login page using the Chrome debugger.

@astra137
Copy link
Owner

astra137 commented Oct 9, 2020

I am fairly confident that this cannot be done in the context of Node.js, since ReCAPTCHA is designed to work in a browser with a human present.

In my experiments, it is possible to get a website session to work without the captcha, by first making a call to the user/security/location endpoint, then authenticating without specifying an agent. It only sometimes worked. I might do more research to see if I can find a reliable way to access the private user APIs.

@PretendingToCode
Copy link
Author

That's interesting, works exactly as you described it. After a few uses the token becomes invalid, but I noticed that sending a request to that endpoint again will "refresh" the token and make it work for a short amount of time.

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