Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/florianmichael/waybackauthlib
Addon for Mojang's AuthLib to support Yggdrasil authentication again
https://github.com/florianmichael/waybackauthlib
authlib backport mojang-authentication third-party yggdrasil
Last synced: about 1 month ago
JSON representation
Addon for Mojang's AuthLib to support Yggdrasil authentication again
- Host: GitHub
- URL: https://github.com/florianmichael/waybackauthlib
- Owner: FlorianMichael
- License: apache-2.0
- Created: 2023-09-25T13:04:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-15T07:52:58.000Z (3 months ago)
- Last Synced: 2024-09-15T10:49:08.283Z (3 months ago)
- Topics: authlib, backport, mojang-authentication, third-party, yggdrasil
- Language: Java
- Homepage:
- Size: 189 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# WaybackAuthLib
Addon for Mojang's AuthLib to support Yggdrasil authentication again
### This library required the AuthLib to be installed as a dependency## Why?
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.## Contact
If you encounter any issues, please report them on the [issue tracker](https://github.com/FlorianMichael/WaybackAuthLib/issues).
If you just want to talk or need help with WaybackAuthLib feel free to join my [Discord](https://discord.gg/BwWhCHUKDf).## How to add this to your project
### Gradle/Maven
To use WaybackAuthLib with Gradle/Maven you can use [Maven Central](https://mvnrepository.com/artifact/de.florianmichael/WaybackAuthLib), [Lenni0451's Maven](https://maven.lenni0451.net/#/releases/de/florianmichael/WaybackAuthLib) or [Jitpack](https://jitpack.io/#FlorianMichael/WaybackAuthLib).
You can also find instructions how to implement it into your build script there.### Jar File
If you just want the latest jar file you can download it from the GitHub [Actions](https://github.com/FlorianMichael/WaybackAuthLib/actions) or use the [Release](https://github.com/FlorianMichael/WaybackAuthLib/releases).## Example usage
### Login with username and password / access token, log out and verify session
```java
final WaybackAuthLib authenticator = new WaybackAuthLib("", 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
```