From 6bcf0ef47ed2db457637e280a49d861d6771dfcb Mon Sep 17 00:00:00 2001 From: Steven Tracey Date: Thu, 6 Jul 2023 12:37:29 -0400 Subject: [PATCH] Last Day --- .../tech/nevets/jaml/auth/AuthRequests.java | 87 ------------------- 1 file changed, 87 deletions(-) diff --git a/src/main/java/tech/nevets/jaml/auth/AuthRequests.java b/src/main/java/tech/nevets/jaml/auth/AuthRequests.java index 16da995..e69de29 100644 --- a/src/main/java/tech/nevets/jaml/auth/AuthRequests.java +++ b/src/main/java/tech/nevets/jaml/auth/AuthRequests.java @@ -1,87 +0,0 @@ -package tech.nevets.jaml.auth; - -import tech.nevets.jaml.util.DataCompressor; -import tech.nevets.jaml.util.HttpUtils; - -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Map; - -public class AuthRequests { - - public static DataCompressor initGet() { - try { - URI liveLogin = new URI("https://login.live.com/oauth20_authorize.srf?client_id=000000004C12AE6F&redirect_uri=https://login.live.com/oauth20_desktop.srf&scope=service::user.auth.xboxlive.com::MBI_SSL&display=touch&response_type=token&locale=en"); - Map headers = new HashMap<>(); - - String response = HttpUtils.get(liveLogin, headers); - String urlPost = ""; - String value = ""; - - System.out.println("Response: " + response); - - String[] cutResponse = response.split("<"); - - for (String cut : cutResponse) { - if (cut.contains("urlPost")) { - urlPost = cut; - } - if (cut.contains("value")) { - value = cut; - } - } - - while (urlPost.indexOf(",urlPost:") < urlPost.indexOf("',at:true")) { - urlPost = urlPost.substring(urlPost.indexOf(",urlPost:") + 10, urlPost.indexOf("',at:true")); - } - - while (value.indexOf("value=\"") < value.indexOf("\"/>',")) { - value = value.substring(value.indexOf("value=\"") + 7, value.indexOf("\"/>',")); - } - - System.out.println("Param 1: " + urlPost); - System.out.println("Param 2: " + value); - - return new DataCompressor(urlPost, value); - - } catch (URISyntaxException e) { - e.printStackTrace(); - - return new DataCompressor(); - } - } - - public static String loginMicrosoft() { - DataCompressor urlPostPlusValue = initGet(); - String urlPost = urlPostPlusValue.getKey(); - String value = urlPostPlusValue.getValue(); - - String accountEmail = "SVTracey9@gmail.com"; - String accountPassword = "Dolly1000!!"; - - try { - Map headers = new HashMap<>(); - - Map data = new HashMap<>(); - data.put("login", accountEmail); - data.put("loginfmt", accountEmail); - data.put("passwd", accountPassword); - data.put("PPFT", value); - - String response = HttpUtils.post(new URI(urlPost), headers, data); - - System.out.println(response); - - return ""; - } catch (URISyntaxException e) { - e.printStackTrace(); - return ""; - } - - } - - public static void loginMSApi() { - - } -}