Skip to content

Commit

Permalink
fix auth
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 committed Jan 6, 2024
1 parent e92ed0e commit 0904e5e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions azalea-auth/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ pub async fn get_ms_link_code(
Ok(client
.post("https://login.live.com/oauth20_connect.srf")
.form(&vec![
("scope", "XboxLive.signin%20offline_access"),
("scope", "XboxLive.signin offline_access"),
("client_id", CLIENT_ID),
("response_type", "device_code"),
])
Expand Down Expand Up @@ -421,7 +421,7 @@ async fn auth_with_xbox_live(
"SiteName": "user.auth.xboxlive.com",
// i thought this was supposed to be d={} but it doesn't work for
// me when i add it ??????
"RpsTicket": format!("{access_token}")
"RpsTicket": format!("d={access_token}")
},
"RelyingParty": "http://auth.xboxlive.com",
"TokenType": "JWT"
Expand All @@ -438,9 +438,10 @@ async fn auth_with_xbox_live(
.body(payload)
.send()
.await?
.json::<XboxLiveAuthResponse>()
.text()
.await?;
tracing::trace!("Xbox Live auth response: {:?}", res);
let res: XboxLiveAuthResponse = serde_json::from_str(&res).unwrap();

// not_after looks like 2020-12-21T19:52:08.4463796Z
let expires_at = DateTime::parse_from_rfc3339(&res.not_after)
Expand Down

0 comments on commit 0904e5e

Please sign in to comment.