fn2006 / PollyMC

DRM-free Prism Launcher fork with support for custom auth servers.
GNU General Public License v3.0
754 stars 48 forks source link

[Request] Generic authlib-injector account system #66

Closed ghost closed 7 months ago

ghost commented 1 year ago

Role

I play Minecraft.

Suggestion

I want to sign in to non-Elyby servers.

Benefit

so I can log in to more servers

This suggestion is unique

You may use the editor below to elaborate further.

Different servers have online-mode set to true for different skin servers. For example, one server might have you sign up on LittleSkin and another on Blessing Skin in order to login through it with authlib-injector. On HMCL you can add these authenticators manually by setting the server instead.

Right now, PollyMC only has Local (so none), ElyBy, or Mojang, but no option to add servers manually.

fn2006 commented 1 year ago

https://github.com/PrismLauncher/PrismLauncher/pull/543 sounds like what you want. I want to completely refactor the launcher's integration of authlib-injector since the current method is very messy but I'm currently waiting for that Prism PR I mentioned to either be merged or closed before I start the refactor.

ghost commented 1 year ago

Huh, I didn't think it would even be considered due to the opportunities for piracy it opens up.

fn2006 commented 1 year ago

Eh, I'd say piracy is main reason people use custom auth servers but there are also other more legitimate reasons for it like custom capes, high resolution skins, having a backup in case MS pulls the plug on Java Edition's servers, etc.

kianfakheriaghdam commented 8 months ago

PrismLauncher/PrismLauncher#543 sounds like what you want. I want to completely refactor the launcher's integration of authlib-injector since the current method is very messy but I'm currently waiting for that Prism PR I mentioned to either be merged or closed before I start the refactor.

@fn2006 I have the very same issue as @poopingpenis

I read the link you sent, but it is too complex & I couldn't find anything useful.

I checked it though. I had two accounts of mine in a server without ely.by support. They couldn't see the skin of themselves, but could see each others skins 💀

please tell me, if there is something I can do to see my skin on servers

evan-goode commented 8 months ago

PrismLauncher/PrismLauncher#543 sounds like what you want. I want to completely refactor the launcher's integration of authlib-injector since the current method is very messy but I'm currently waiting for that Prism PR I mentioned to either be merged or closed before I start the refactor.

@fn2006 I have the very same issue as @poopingpenis

I read the link you sent, but it is too complex & I couldn't find anything useful.

I checked it though. I had two accounts of mine in a server without ely.by support. They couldn't see the skin of themselves, but could see each others skins 💀

please tell me, if there is something I can do to see my skin on servers

If all you want is seeing skins on offline servers, and you don't care about using a custom authentication server, try using the CustomSkinLoader mod. On both offline and online servers, it will try loading skins from a variety of sources including Mojang, LittleSkin, and Ely.by. It should let you see both the skin of your player and skins of the other players on the server.

kianfakheriaghdam commented 8 months ago

PrismLauncher/PrismLauncher#543 sounds like what you want. I want to completely refactor the launcher's integration of authlib-injector since the current method is very messy but I'm currently waiting for that Prism PR I mentioned to either be merged or closed before I start the refactor.

@fn2006 I have the very same issue as @poopingpenis I read the link you sent, but it is too complex & I couldn't find anything useful. I checked it though. I had two accounts of mine in a server without ely.by support. They couldn't see the skin of themselves, but could see each others skins 💀 please tell me, if there is something I can do to see my skin on servers

If all you want is seeing skins on offline servers, and you don't care about using a custom authentication server, try using the CustomSkinLoader mod. On both offline and online servers, it will try loading skins from a variety of sources including Mojang, LittleSkin, and Ely.by. It should let you see both the skin of your player and skins of the other players on the server.

@evan-goode I think by offline servers you mean cracked servers, right?

The mod isn't updated past 1.16.5, which is an issue.

Also other players have to have this mod installed. I want to have PollyMC work like TL Legacy.

Couldn't find how to make the mod work with Ely.By

kianfakheriaghdam commented 8 months ago

PrismLauncher/PrismLauncher#543 sounds like what you want. I want to completely refactor the launcher's integration of authlib-injector since the current method is very messy but I'm currently waiting for that Prism PR I mentioned to either be merged or closed before I start the refactor.

@fn2006 I have the very same issue as @poopingpenis I read the link you sent, but it is too complex & I couldn't find anything useful. I checked it though. I had two accounts of mine in a server without ely.by support. They couldn't see the skin of themselves, but could see each others skins 💀 please tell me, if there is something I can do to see my skin on servers

If all you want is seeing skins on offline servers, and you don't care about using a custom authentication server, try using the CustomSkinLoader mod. On both offline and online servers, it will try loading skins from a variety of sources including Mojang, LittleSkin, and Ely.by. It should let you see both the skin of your player and skins of the other players on the server.

@evan-goode I tried moving the Ely.By above the Mojang API. I now get crashes when joining servers.

evan-goode commented 8 months ago

I think this discussion is more related to https://github.com/fn2006/PollyMC/issues/107, so I don't mean to derail, but:

@evan-goode I think by offline servers you mean cracked servers, right?

"Offline" meaning servers with online-mode=false set in their server.properties.

The mod isn't updated past 1.16.5, which is an issue.

Ah it looks like the mod description on Curseforge hasn't been updated in a while, but it looks actively developed: https://github.com/xfl03/MCCustomSkinLoader/commits/15-develop. I haven't used it in a while though. Sorry it's not working for you, maybe file a bug report with them if you think you're doing everything right.

Also other players have to have this mod installed. I want to have PollyMC work like TL Legacy.

That's always going to be an issue to some extent; the vanilla client just won't load skins in offline mode. I assume you mean that you want two PollyMC users, both signed in to Ely.by accounts, to be able to see each other's skins on an offline server without having to manually install additional mods.

PollyMC uses authlib-injector to support third-party authentication servers. authlib-injector forces the client to try to load skins even in offline mode, but loading another player's skin will usually fail since the lookup is done by the player's UUID. In most cases, a player's "online" UUID (which comes from an authentication server such as Mojang or Ely.by and is probably randomly generated), is different from that player's "offline" UUID (which is deterministically generated from the player name). The authlib-injector client requests the skin for the "offline UUID" of the player, but the authentication server only knows the "online UUID".

Ely.by distributes a patched authlib.jar that solves this problem by detecting whether the game is in offline mode, and if it is, requesting skins by the player's name rather than their offline UUID. (I would link the source code to their authlib.jar but I can't find it... maybe it's nonfree?). Their authlib.jar uses Ely.by-specific routes, but the same thing could be done using the vanilla API protocol. I don't know for sure, but I'm guessing TL Legacy used this Ely.by authlib.jar, and that's why offline skins worked.

IMO this is worthwhile to fix, but not by PollyMC. I think the problem is best solved either (1) in authlib-injector, by making it behave like Ely.by's authlib.jar and request skins by player name in offline mode, and/or (2) in the authentication server, by resolving offline UUIDs to the correct skins. I've modified my authentication server to support skins in offline mode with authlib-injector: https://github.com/unmojang/drasl/commit/e8537ea54c1068ae10cef0aaf1ce821698c5d648, I can possibly file a PR making the same changes for Ely.by.

I think the better of those two solutions is to make the change in authlib-injector, since you would only have to change one piece of software rather than many authentication servers.

fn2006 commented 7 months ago

Added in 8.0

kianfakheriaghdam commented 7 months ago

@fn2006 so I updated pollymc to 8.0 & deleted all data from 7.2. I added my ely.by account using the authlibinjector: https://account.ely.by/api/authlib-injector

I make a single player world, my skin works. Then I go to a server, I'm Steve

Touisni commented 7 months ago

@fn2006 so I updated pollymc to 8.0 & deleted all data from 7.2. I added my ely.by account using the authlibinjector: https://account.ely.by/api/authlib-injector

I make a single player world, my skin works. Then I go to a server, I'm Steve

I have the exact same issue, I tried to use ely.by server plugin but it doesn't work. Would love a workaround to this.

dashfader commented 6 months ago

I think this discussion is more related to #107, so I don't mean to derail, but:

@evan-goode I think by offline servers you mean cracked servers, right?

"Offline" meaning servers with online-mode=false set in their server.properties.

The mod isn't updated past 1.16.5, which is an issue.

Ah it looks like the mod description on Curseforge hasn't been updated in a while, but it looks actively developed: https://github.com/xfl03/MCCustomSkinLoader/commits/15-develop. I haven't used it in a while though. Sorry it's not working for you, maybe file a bug report with them if you think you're doing everything right.

Also other players have to have this mod installed. I want to have PollyMC work like TL Legacy.

That's always going to be an issue to some extent; the vanilla client just won't load skins in offline mode. I assume you mean that you want two PollyMC users, both signed in to Ely.by accounts, to be able to see each other's skins on an offline server without having to manually install additional mods.

PollyMC uses authlib-injector to support third-party authentication servers. authlib-injector forces the client to try to load skins even in offline mode, but loading another player's skin will usually fail since the lookup is done by the player's UUID. In most cases, a player's "online" UUID (which comes from an authentication server such as Mojang or Ely.by and is probably randomly generated), is different from that player's "offline" UUID (which is deterministically generated from the player name). The authlib-injector client requests the skin for the "offline UUID" of the player, but the authentication server only knows the "online UUID".

Ely.by distributes a patched authlib.jar that solves this problem by detecting whether the game is in offline mode, and if it is, requesting skins by the player's name rather than their offline UUID. (I would link the source code to their authlib.jar but I can't find it... maybe it's nonfree?). Their authlib.jar uses Ely.by-specific routes, but the same thing could be done using the vanilla API protocol. I don't know for sure, but I'm guessing TL Legacy used this Ely.by authlib.jar, and that's why offline skins worked.

IMO this is worthwhile to fix, but not by PollyMC. I think the problem is best solved either (1) in authlib-injector, by making it behave like Ely.by's authlib.jar and request skins by player name in offline mode, and/or (2) in the authentication server, by resolving offline UUIDs to the correct skins. I've modified my authentication server to support skins in offline mode with authlib-injector: unmojang/drasl@e8537ea, I can possibly file a PR making the same changes for Ely.by.

I think the better of those two solutions is to make the change in authlib-injector, since you would only have to change one piece of software rather than many authentication servers.

@evan-goode Any workaround for this? Especially on servers I know you can just load authlib-injector jar alongside with your server, but unfortunately it's not doable on Aternos or some other free server host

Even with online-mode=false, my skin isn't visible in the server Or is this an expected behavior?

evan-goode commented 6 months ago

@evan-goode Any workaround for this? Especially on servers I know you can just load authlib-injector jar alongside with your server, but unfortunately it's not doable on Aternos or some other free server host

You can use MCCustomSkinLoader on the client side; I've used that in the past. I think there are also a few serverside mods and plugins that deal with this, including https://github.com/samolego/FabricTailor, but I haven't tried any.

Even with online-mode=false, my skin isn't visible in the server Or is this an expected behavior?

Unfortunately yes, for now.

dashfader commented 6 months ago

You can use MCCustomSkinLoader on the client side; I've used that in the past. I think there are also a few serverside mods and plugins that deal with this, including https://github.com/samolego/FabricTailor, but I haven't tried any.

Oh, i didn't know these kind of mod actually exists especially the ones that read from Ely.by. Thanks!

Unfortunately yes, for now.

I see, that's a shame though. I hope a good solution is found for this someday