-
Notifications
You must be signed in to change notification settings - Fork 13
Online auth system testing #14
Comments
Huh, I tested in offline mode and for me everything worked. Can you send your configuration file and server log? |
Configuration: {
"version": 1,
"sessions-enabled": false,
"sessions-valid-hours": "6",
"skip-online-auth": true,
"password-type": "local",
"global-password": "123456"
} Logs: |
Added a breakpoint to see the real and actual uuid
|
Forgot to mention in the reproduction steps that sessions have to be disabled |
I don't see any good solutions for this. I will think about removing this feature at all. |
This now needs testing. Please, download the build from: |
I have tested all combinations of online and offline players, everything works fine, the only problem is now susceptibility to bot attacks on [online mod] servers .. using many generated nicks like: Xd67dhsXkD |
No issues was found, closing this now. Feel free to reopen this if you found an error before 1.2.1 release. |
is it possible to modify the code so that when it tries to connect a non-original client that has used (stolen) the name of the original client... it writes a specific error phrase? For example : You can't use the nickname of the original player |
Describe the bug
The online mode bypass doesn't work.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The mod should authenticate the player when it has already registered and has a Minecraft account.
Version
Mod version: 1.2.0 (I'm using the mod built from #13)
Minecraft version: 1.16.5
Fabric version: 0.36.0+1.16
The reason
Click to expand
(I have studied this part of Minecraft before when I tried to create an auth mod with online mode authentication.)
The reason this happens is simple: when the server is in offline mode, all players are assigned an UUID based on their username (see
PlayerEntity#getOfflinePlayerUuid
). (The UUID for all players is generated by the server, not by the client). Your code doesn't work because it compares the uuid generated by the offline server with the official one, which are always different.The solution
Click to expand
I can only think of three solutions.
ServerLoginNetworkHandler#onHello
), checking if a Minecraft account with the same username exists. If so, making the Minecraft server handle the authentication and if not, just letting the player pass and authenticate the normal way (/login
). This would cause players with the username of a valid Minecraft account to not be able to join the server.Do note that the second and third would make players using an official account to use their online-mode-uuid, so they would be able to change their account username and save all their data, but losing the data from when they didn't have the option toggled on.
The letting pass an offline player or authenticate an online one part can be done with just a single mixin
Code
The text was updated successfully, but these errors were encountered: