6 releases (3 breaking)
0.4.1 | May 19, 2022 |
---|---|
0.4.0 | Apr 21, 2022 |
0.3.1 | Apr 12, 2022 |
0.2.0 | Mar 11, 2022 |
0.1.0 | Feb 23, 2022 |
#86 in #microsoft
16KB
309 lines
ms_auth_mc
This library is for logging into a minecraft account by using the microsoft oauth2 device flow: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code
Example
use {ms_auth_mc::*, reqwest::blocking::Client};
let client = Client::new();
let device_code =
DeviceCode::new("389b1b32-b5d5-43b2-bddc-84ce938d6737"/* You would ideally replace this with your own CID*/, None, &client).unwrap();
if let Some(inner) = &device_code.inner {
println!("{}", inner.message);
}
let auth = device_code.authenticate(&client).unwrap();
println!("{}", auth.token);
You can create your own cid by making an azure application.
ms_auth_mc has been moved to the auth feature of the minceraft crate, it will no longer receive updates here!
lib.rs
:
This library is for logging into a minecraft account using the microsoft oauth2 device flow: https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-device-code
Example
use {ms_auth_mc::*, reqwest::blocking::Client};
let client = Client::new();
let device_code =
DeviceCode::new("389b1b32-b5d5-43b2-bddc-84ce938d6737"/* You would ideally replace this with your own CID which you can get from creating an azure application*/, None, &client).unwrap();
if let Some(inner) = &device_code.inner {
println!("{}", inner.message);
}
let auth = device_code.authenticate(&client).unwrap();
println!("{}", auth.token);
Dependencies
~5–17MB
~239K SLoC