PrismarineJS / PrismarineJS/node-minecraft-protocol

MCLeaks authentication not working

Open
#736 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

new feature non-vanilla
Dominant language
JavaScript
Stars
1.4k
Forks
290
Avg merge
4d 8h
Merged PRs (30d)
7

Description

[x] The FAQ doesn't contain a resolution to my issue

Versions

  • minecraft-protocol: 13.0.0
  • server: vanilla 1.15.2
  • node: 14.0.0

Detailed description of a problem

My question is how would I go about authenticating a user successfully with mcleaks?

my current attempt:
When I use a session from mcleaks, the client partially connects to the server, but does not join, and the client nmp gets stuck after a promise rejection. If I end the node process, the server shows that the player was disconnected, and has the account name, but no id.

Current code

var mc = require('minecraft-protocol');

var client = mc.createClient({
    username: "McLeaks",
    version: "1.15.2",
    session: {
        accessToken: "<Token from response to requesting MCLeaks API to redeem a alt token>",
        selectedProfile: {
            name: "<Alt Username from response to requesting MCLeaks API to redeem a alt token>"
        }
    }
});

Expected behaviour

The client joins the server with the username and account provided from mcleaks

Additional context

the warning that is shown after the client tries to log on

(node:7356) UnhandledPromiseRejectionWarning: Error
    at /Users/vrishank/node_modules/yggdrasil/lib/utils.js:60:10
    at /Users/vrishank/node_modules/phin/lib/phin.min.js:1:1150
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:7356) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function wit
hout a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, us
e the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7356) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will 
terminate the Node.js process with a non-zero exit code.

the message that is shown by the server after the client (failed to connect) terminates

[09:41:58] [Server thread/INFO]: com.mojang.authlib.GameProfile@4d47979[id=<null>,name=<alt username>,properties={},legacy=false] (/127.0.0.1:54121) lost connection: Disconnected```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided createClient session configuration and the rejection reported from yggdrasil/lib/utils.js. Compare the behavior against docs/FAQ.md and reproduce with minecraft-protocol 13.0.0, Node 14.0.0, and Minecraft 1.15.2. Done means the supplied MCLeaks session reaches the server and joins with the expected username, without an unhandled rejection.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
authentication
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.