Addon for Mojang's AuthLib to support Yggdrasil authentication again
With the release of AuthLib 5.0, Mojang has removed all API methods to log in via the Yggdrasil Authentication system, as Yggdrasil has been officially terminated. However, many third-party log in methods use the Yggdrasil interface as a reference, this library is an addon for the AuthLib which adds all old methods back using the internals of the AuthLib to be as compact as possible. This library will probably also be used in the future to restore even more methods that have been removed from the AuthLib.
If you encounter any issues, please report them on
the issue tracker.
If you just want to talk or need help with WaybackAuthLib feel free to join
my Discord.
To use WaybackAuthLib with Gradle/Maven you can
use the Maven Central repository
or my own repository.
You can also find instructions how to implement it into your build script there.
If you just want the latest jar file you can download it from my build server, GitHub Actions or use the releases tab.
final WaybackAuthLib authenticator = new WaybackAuthLib("<your auth host server>", clientToken, Proxy.NO_PROXY);
authenticator.
setUsername(username);
authenticator.
setPassword(password);
// You can also use authenticator.setAcessToken(), the logIn method will then refresh the acess token
// if it is expired (once you logged in using username/password, the access token field will also be updated automatically)
authenticator.
logIn();
if(authenticator.
isLoggedIn()){
final GameProfile profile = authenticator.getCurrentProfile();
// Do something with the profile
}
final boolean isTokenValid = authenticator.checkTokenValidity();
if(isTokenValid){
// Do something
}
authenticator.
logOut(); // This will invalidate the access token and reset all storages