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

How should we patch authlib to fix skins? #4

Closed
catfromplan9 opened this issue Apr 28, 2023 · 13 comments
Closed

How should we patch authlib to fix skins? #4

catfromplan9 opened this issue Apr 28, 2023 · 13 comments

Comments

@catfromplan9
Copy link
Contributor

https://account.server.org/users/profiles/minecraft/name returns http code 500

@catfromplan9
Copy link
Contributor Author

I get internal server error going to any api, yet game still works

@catfromplan9
Copy link
Contributor Author

every page, it seems, at least in my browser returns http code 500

@catfromplan9
Copy link
Contributor Author

catfromplan9 commented Apr 28, 2023

Console says "Not found" but how? this is standard yggdrasil api stuff

@catfromplan9
Copy link
Contributor Author

It uploads via website, i can see it on my launcher, but it does not work on the server... strange... ^ I think now that the api could be working fine, it is just something I am doing wrong. I'm new to working with this, apologies

@catfromplan9
Copy link
Contributor Author

authlib-injector had issue with skins in 1.19.4 that got fixed in the most recent update, but im not sure if its related

@evan-goode
Copy link
Member

Hey! Yes, this project is indev so to speak and pretty much only the bare minimum API routes are implemented so far, that's why https://account.server.org/users/profiles/minecraft/name isn't working for you. I actually did implement that route but I incorrectly put it under the "services" enpoint rather than the "account" endpoint, whoops.

But skins should work both in Prism Launcher and in the game, with a catch. The vanilla Minecraft client refuses to load skins from non-Mojang domains, and I'm guessing that's what's happening in your case. You can fix that with this Fabric mod: https://github.com/unmojang/DraslTweaks. I just updated it for 1.19.4 but I'd like to support all recent versions of Minecraft eventually.

Out of curiosity, are you using the patched Prism Launcher or PolyMC here? PrismLauncher/PrismLauncher#543 Or some other launcher?

@catfromplan9
Copy link
Contributor Author

Hey! Yes, this project is indev so to speak and pretty much only the bare minimum API routes are implemented so far, that's why https://account.server.org/users/profiles/minecraft/name isn't working for you. I actually did implement that route but I incorrectly put it under the "services" enpoint rather than the "account" endpoint, whoops.

But skins should work both in Prism Launcher and in the game, with a catch. The vanilla Minecraft client refuses to load skins from non-Mojang domains, and I'm guessing that's what's happening in your case. You can fix that with this Fabric mod: https://github.com/unmojang/DraslTweaks. I just updated it for 1.19.4 but I'd like to support all recent versions of Minecraft eventually.

Out of curiosity, are you using the patched Prism Launcher or PolyMC here? PrismLauncher/PrismLauncher#543 Or some other launcher?

ohh thanks, i didnt see this fabric mod. But I would prefer if the solution was simpler than that. The auth server I use rn fixes this with a java class injector thing called authlib-injector. I think you could modify your prism fork to include a java program that injects into the auth lib and have the flag to inject it be automatically inserted if the account being used is a custom auth server

@catfromplan9
Copy link
Contributor Author

also, i really do encourage you to continue on this project. The auth system i am using rn feels very bloated and I like simpler things with less moving parts (js and such), to keep it easy to modify for my interests

@catfromplan9
Copy link
Contributor Author

Bump, please consider the above solution for better futureproofing (since mods need to be remade every version)

@catfromplan9
Copy link
Contributor Author

I think a good idea would be to add support for authlib-injector, incase someone prefers it. Here is the code for how api URLs are remapped

https://github.com/yushijinhun/authlib-injector/blob/develop/src/main/java/moe/yushi/authlibinjector/httpd/DefaultURLRedirector.java

And here is how option for custom server is parsed

https://github.com/yushijinhun/authlib-injector/blob/develop/src/main/java/moe/yushi/authlibinjector/AuthlibInjector.java

@evan-goode evan-goode mentioned this issue Jun 3, 2023
5 tasks
@evan-goode
Copy link
Member

ohh thanks, i didnt see this fabric mod. But I would prefer if the solution was simpler than that. The auth server I use rn fixes this with a java class injector thing called authlib-injector. I think you could modify your prism fork to include a java program that injects into the auth lib and have the flag to inject it be automatically inserted if the account being used is a custom auth server

Yeah, I'm a little lukewarm on authlib-injector's approach, see PrismLauncher/PrismLauncher#543 (comment). And I'm doubtful I could get something like that merged into Prism. But this more automatic functionality may be appropriate to implement if I end up maintaining a fork of Prism Launcher.

Bump, please consider the above solution for better futureproofing (since mods need to be remade every version)

Yes, that's a big downside of the Fabric approach. TBH I don't know much about modding, there might be a way to make a mod that is somewhat resilient to updates and that can work on many versions. Historically, authlib hasn't changed much version-to-version, but we will see whether 1.19 will mark the start of a change in that trend, or whether these recent changes were just a one-off thing.

I think a good idea would be to add support for authlib-injector, incase someone prefers it. Here is the code for how api URLs are remapped

Strongly agree, it seems to be the dominant way people currently use custom API servers. I opened #6.

also, i really do encourage you to continue on this project. The auth system i am using rn feels very bloated and I like simpler things with less moving parts (js and such), to keep it easy to modify for my interests

Thank you very much, I appreciate your interest! Yes, one of my goals is to make it extremely easy to deploy, configure, and modify to suit a wide variety of use cases. And to keep the web interface highly accessible and minimalistic, only using JavaScript for extra visuals like the skinview3d preview.

The https://account.drasl.example.org/users/profiles/minecraft/<playerName> and most other Mojang routes are implemented now, but I may keep this issue open for a bit to discuss options for patching authlib.

@evan-goode evan-goode changed the title Cannot use skins (even in 1.19.1) How should we patch authlib to fix skins? Jun 3, 2023
@catfromplan9
Copy link
Contributor Author

catfromplan9 commented Jun 18, 2023

Yeah, I'm a little lukewarm on authlib-injector's approach, see PrismLauncher/PrismLauncher#543 (comment). And I'm doubtful I could get something like that merged into Prism. But this more automatic functionality may be appropriate to implement if I end up maintaining a fork of Prism Launcher.

I do urge you to maintain a prism fork. A makedeb and makepkg will cover debian and arch based binaries, which is the majority of what you need to deal with. Arch pkgbuild can just be on aur too and not need a build server

The https://account.drasl.example.org/users/profiles/minecraft/ and most other Mojang routes are implemented now, but I may keep this issue open for a bit to discuss options for patching authlib.

Awesome to hear

@evan-goode
Copy link
Member

Closing now that PollyMC supports custom auth servers: https://github.com/fn2006/PollyMC.

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