Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package me.callofcaos.lorien.altmanager;
- import java.net.Proxy;
- import net.minecraft.util.Session;
- import com.mojang.authlib.Agent;
- import com.mojang.authlib.exceptions.AuthenticationException;
- import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
- import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
- /*
- * Author: Opim10
- * Version: 1
- * Use: Yggdrasil Utils for YggdrasilAuthenticator;
- */
- public class YggdrasilPayload {
- public Session loginPassword(String username, String password)
- {
- if(username == null || username.length() <= 0 || password == null || password.length() <= 0)
- return null;
- YggdrasilAuthenticationService a = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
- YggdrasilUserAuthentication b = (YggdrasilUserAuthentication)a.createUserAuthentication(Agent.MINECRAFT);
- b.setUsername(username);
- b.setPassword(password);
- try
- {
- b.logIn();
- return new Session(b.getSelectedProfile().getName(), b.getSelectedProfile().getId(), b.getAuthenticatedToken());
- } catch (AuthenticationException e)
- {
- e.printStackTrace();
- }
- return null;
- }
- public Session loginCrack(String username)
- {
- return new Session(username, "", "");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement