Skip to content

JAuth is an library for TrixCMS, for using custom auth between java and TrixCMS By antoineok. (For exemple : For your modded minecraft project...)

Notifications You must be signed in to change notification settings

TrixCMS-V-2/JAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAuth

JAuth is an library for using custom auth between java and TrixCMS. (For exemple : For your modded minecraft project...)

For using, see the Demo.java

Warning : You need install the "Auth" Plugin on your dashboard https://trixcms.eu/marketplace/resource/plugin/7


Login with password

Using with OpenLauncherLib: in the auth function: replace this:

Authenticator authenticator = new Authenticator(Authenticator.MOJANG_AUTH_URL, AuthPoints.NORMAL_AUTH_POINTS);
AuthResponse response = authenticator.authenticate(AuthAgent.MINECRAFT, username, password, "");
authInfos = new AuthInfos(response.getSelectedProfile().getName(), response.getAccessToken(), response.getSelectedProfile().getId());

by this:

JAuth auth = new JAuth("NomDuSite", "UrlDuSite");
auth.connect("pseudo", "mot de passe");
switch (auth.getAuthStatus()) {
    case CONNECTED:
        System.out.println("Token: " + auth.getProfile().getToken());
        System.out.println("Uuid: " + auth.getProfile().getUuid());
        System.out.println("Mail: " + auth.getProfile().getUserMail());
		authinfos = new AuthInfos(auth.getProfile().getUserName(), auth.getProfile().getToken(), auth.getProfile().getUuid());
        break;
    case CONNECTION:
        // Connection in progress
        break;
    case DISCONNECTED:
        // Not connected
        break;
}

Login with token

JAuth auth = new JAuth("NomDuSite", "UrlDuSite");
auth.validate("pseudo", "token");
System.out.println("Token: " + auth.getProfile().getToken());
System.out.println("Uuid: " + auth.getProfile().getUuid());
System.out.println("Mail: " + auth.getProfile().getUserMail());

refresh the token

JAuth auth = new JAuth("NomDuSite", "UrlDuSite");
auth.refresh("pseudo", "token");

About

JAuth is an library for TrixCMS, for using custom auth between java and TrixCMS By antoineok. (For exemple : For your modded minecraft project...)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages