Advertisement
Guest User

Untitled

a guest
Jun 25th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. package me.callofcaos.lorien.utils.yggdrasil;
  2.  
  3. import java.net.Proxy;
  4.  
  5. import net.minecraft.util.Session;
  6.  
  7. import com.mojang.authlib.Agent;
  8. import com.mojang.authlib.exceptions.AuthenticationException;
  9. import com.mojang.authlib.yggdrasil.YggdrasilAuthenticationService;
  10. import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
  11.  
  12. /*
  13. * Author: Opim10
  14. * Version: 1
  15. * Use: Yggdrasil Utils for YggdrasilAuthenticator;
  16. */
  17.  
  18. public class YggdrasilPayload {
  19.  
  20. public static Session loginPassword(String username, String password)
  21. {
  22. if(username == null || username.length() <= 0 || password == null || password.length() <= 0)
  23. return null;
  24.  
  25. YggdrasilAuthenticationService a = new YggdrasilAuthenticationService(Proxy.NO_PROXY, "");
  26. YggdrasilUserAuthentication b = (YggdrasilUserAuthentication)a.createUserAuthentication(Agent.MINECRAFT);
  27. b.setUsername(username);
  28. b.setPassword(password);
  29. try
  30. {
  31. b.logIn();
  32. return new Session(b.getSelectedProfile().getName(), b.getSelectedProfile().getId().toString(), b.getAuthenticatedToken(), "mojang");
  33. } catch (AuthenticationException e)
  34. {
  35. e.printStackTrace();
  36. System.out.println("Failed login: "+username+":"+password);
  37. }
  38. return null;
  39. }
  40.  
  41. public static Session loginCrack(String username)
  42. {
  43. return new Session(username, "", "", "mojang");
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement