Authlib Injector
How YggUtils uses authlib-injector to redirect Minecraft authentication to a custom server.
YggUtils uses authlib-injector to redirect Minecraft's authentication calls from Mojang's servers to your custom Yggdrasil backend.
What Is authlib-injector?
authlib-injector is a Java agent that patches Minecraft's bundled authlib at runtime using bytecode manipulation. When attached to the JVM via -javaagent, it intercepts all outgoing authentication requests and rewrites the target URLs — replacing sessionserver.mojang.com and authserver.mojang.com with your custom server.
Automatic Download
YggUtils downloads authlib-injector automatically on first run if it isn't already present, saving it to:
meta/authlibinjector.jarInfo
If you want to use a specific version of authlib-injector, place the JAR file manually at meta/authlibinjector.jar before running YggUtils. The download is skipped if the file already exists.
How It Is Attached
YggUtils passes authlib-injector to the server JVM using the standard Java agent flag:
-javaagent:meta/authlibinjector.jar=<authserver>The value after = is your authserver URL from YggUtils.yml. On server startup, authlib-injector fetches the API metadata from this URL to configure its URL rewrites.
Auth Server Requirements
Your authentication server must:
- Implement the Yggdrasil API
- Expose an API root URL that authlib-injector can query for its metadata
Most self-hosted solutions such as blessing-skin-server support this out of the box.
The authserver value in your config should be the root URL only:
authserver: https://auth.example.comauthlib-injector appends the necessary API paths itself — do not include a trailing path.
Updating authlib-injector
To update to a newer version, replace meta/authlibinjector.jar with the new JAR manually. YggUtils will use whatever file is present at that path without any additional changes required.