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

drasl authlib-injector accounts doesn't have skin in single-player #32

Open
1 task done
vibrantrida opened this issue Sep 13, 2024 · 8 comments
Open
1 task done
Labels
bug Something isn't working

Comments

@vibrantrida
Copy link

vibrantrida commented Sep 13, 2024

Operating System

Windows

Version of Fjord Launcher

Fjord Launcher 8.4.2

Version of Qt

I dont know what Qt version 8.4.2 uses

Description of bug

An authlib-injector account with a self-hosted drasl server on docker doesn't have a skin even in single-player world

On Fjord Launcher's Accounts page, it shows that the status for the drasl authlib-injector account is "Ready".

On Docker I can see that Fjord requested for the skin, and I can confirm that there are no errors, the status code is 200.

2024-09-14 08:30:27 drasl-1  | {"time":"2024-09-14T00:30:27.169898842Z","id":"","remote_ip":"172.18.0.1","host":"localhost:25585","method":"POST","uri":"/authlib-injector/authserver/refresh","user_agent":"Mozilla/5.0","status":200,"error":"","latency":14592836,"latency_human":"14.592836ms","bytes_in":999,"bytes_out":1118}
2024-09-14 08:30:27 drasl-1  | {"time":"2024-09-14T00:30:27.172222094Z","id":"","remote_ip":"172.18.0.1","host":"localhost:25585","method":"GET","uri":"/authlib-injector/sessionserver/session/minecraft/profile/1daaca41ef7f4ebaac14ebe0b625305d","user_agent":"Mozilla/5.0","status":200,"error":"","latency":1045106,"latency_human":"1.045106ms","bytes_in":0,"bytes_out":469}
2024-09-14 08:30:27 drasl-1  | {"time":"2024-09-14T00:30:27.173358426Z","id":"","remote_ip":"172.18.0.1","host":"localhost:25585","method":"GET","uri":"/authlib-injector","user_agent":"Mozilla/5.0","status":200,"error":"","latency":2735,"latency_human":"2.735µs","bytes_in":0,"bytes_out":1938}
2024-09-14 08:30:27 drasl-1  | {"time":"2024-09-14T00:30:27.176466815Z","id":"","remote_ip":"172.18.0.1","host":"localhost:25585","method":"GET","uri":"/web/texture/skin/9eb7aff4ed3c27e81488ed82c2a1a19a32135d1e7d778165302edc8a07e1860e.png","user_agent":"Mozilla/5.0","status":200,"error":"","latency":2068379,"latency_human":"2.068379ms","bytes_in":0,"bytes_out":4117}

Steps to reproduce

  1. Self-host Drasl on Docker
  2. Create a Drasl account, add a custom skin, and then add an authlib-injector on Fjord Launcher
  3. Play a single-player world, open Inventory to check skin

Suspected cause

No response

This issue is unique

  • I have searched the issue tracker and did not find an issue describing my bug.
@vibrantrida vibrantrida added the bug Something isn't working label Sep 13, 2024
@evan-goode
Copy link
Member

Hi, I can't reproduce this.

  • What version of Minecraft?
  • Have you installed authlib-injector on the Minecraft instance in Fjord Launcher (edit instance -> Version -> Install authlib-injector)? It should prompt to install authlib-injector automatically if you try to launch the instance with an authlib-injector account selected in Fjord.
  • Does the correct skin show up in the top right corner of the Fjord Launcher main window (in the account selection dropdown menu)?

@vibrantrida
Copy link
Author

Hi, I can't reproduce this.

* What version of Minecraft?

* Have you installed authlib-injector on the Minecraft instance in Fjord Launcher (edit instance -> Version -> Install authlib-injector)? It should prompt to install authlib-injector automatically if you try to launch the instance with an authlib-injector account selected in Fjord.

* Does the correct skin show up in the top right corner of the Fjord Launcher main window (in the account selection dropdown menu)?
  • The issue happens in 1.16.5+

  • Yes, all instances I play have authlib-injector installed

  • Yes, the correct skin shows in the top-left dropdown menu

@evan-goode
Copy link
Member

Any relevant errors in the Minecraft Log (Edit instance -> Minecraft Log) when you load the singleplayer world (or earlier)? My first idea is that the Domain setting in your Drasl's config.toml is not set correctly.

@vibrantrida
Copy link
Author

You are right, I am getting connection refused error according to the logs

Here's the relevant variables in config.toml:

# Example: drasl.example.com
Domain = "localhost:25585"

# Example: https://drasl.example.com
BaseURL = "http://localhost:25585"

I don't want to use a reverse proxy since I only plan to run this on the local network

@evan-goode
Copy link
Member

Ah, I haven't tried setting up Drasl without TLS. I'll play around and see if I can get it working, but no promises. Not supporting plain HTTP might be a limitation (or conscious decision) of authlib-injector.

I recommend setting up a reverse proxy with an self-signed certificate. You could use https://caddyserver.com/docs/caddyfile/directives/tls#internal.

@evan-goode
Copy link
Member

Hmm, actually plain HTTP works for me fine. I used localhost as the Domain without the :25585. But I'm not sure that would cause the error you're seeing.

This line of your logs looks relevant:

Caused by: com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

Is there anything in the Drasl log when you load the world? i.e. any Drasl logs from requests generated by the Minecraft client rather than Fjord Laucnher?

@vibrantrida
Copy link
Author

There is no other logs on Drasl's side other than when Fjord sent a request to it.

@evan-goode
Copy link
Member

A couple more things to check:

  • Try deleting and re-adding the authlib-injector account in Fjord Launcher. Make sure the server URL is exactly http://localhost:25585/authlib-injector.
  • Check that the Minecraft client logs contain:
[authlib-injector] [INFO] Authentication server: http://localhost:25585/authlib-injector
[authlib-injector] [WARNING] You are using HTTP protocol, which is INSECURE! Please switch to HTTPS if possible.

If that doesn't help, the next thing I would do to debug is to man-in-the-middle the traffic between the Minecraft client and Drasl. It looks like the client is sending requests to the wrong place (something, probably not Drasl, is responding with "Internal server error"). I use mitmproxy for this but there are alternatives.

Then in Fjord Launcher, you'll need to go to Edit Instance -> Settings -> Java -> Java arguments and add

-Dhttp.proxyHost=localhost -Dhttp.proxyPort=8080 -Dhttps.proxyHost=localhost -Dhttps.proxyPort=8080

to proxy traffic through mitmproxy (or whatever).

There's a little more setup involved if you want to decrypt HTTPS traffic, but that might not be necessary here. Feel free to ask in https://matrix.to/#/!nntYkUIkaZiKmXZYne:matrix.org?via=matrix.org&via=envs.net&via=besties.house if you want more guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants