From ead933d2207825d4dd292e980aacefe6cb8bf504 Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Thu, 30 Jan 2025 12:09:37 -0600 Subject: non-working: auth --- src/auth/msa.rs | 33 +++++++++++++++++++++++++++++++++ src/auth/types.rs | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src/auth') diff --git a/src/auth/msa.rs b/src/auth/msa.rs index e69de29..da9a376 100644 --- a/src/auth/msa.rs +++ b/src/auth/msa.rs @@ -0,0 +1,33 @@ +use chrono::{DateTime, Utc}; +use oauth2::AccessToken; +use serde::{Deserialize, Serialize}; +use crate::auth::AuthError; + +const XBOX_LIVE_AUTH: &str = "https://user.auth.xboxlive.com/user/authenticate"; + +#[derive(Debug, Serialize)] +#[serde(rename_all = "PascalCase")] +struct XboxLiveAuthRequestProperties<'a> { + auth_method: &'a str, + site_name: &'a str, + rps_ticket: &'a str +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "PascalCase")] +struct XboxLiveAuthRequest<'a> { + properties: XboxLiveAuthRequestProperties<'a>, + relying_party: &'a str, + token_type: &'a str +} + +#[derive(Debug, Deserialize)] +#[serde(rename_all = "PascalCase")] +struct XboxLiveAuthResponse { + token: String, + not_after: DateTime +} + +pub fn xbox_live_login(client: &reqwest::Client, access_token: &AccessToken) -> Result<(), AuthError> { + +} \ No newline at end of file diff --git a/src/auth/types.rs b/src/auth/types.rs index 79cf84f..f455657 100644 --- a/src/auth/types.rs +++ b/src/auth/types.rs @@ -31,7 +31,7 @@ pub(super) struct Token { pub struct MsaUser { #[serde(skip_serializing_if = "Option::is_none")] pub profile: Option, - pub xuid: Uuid, + pub xuid: Option, pub(super) client_id: oauth2::ClientId, -- cgit v1.2.3-70-g09d2