Crates.io | ms_auth_mc |
lib.rs | ms_auth_mc |
version | 0.4.1 |
source | src |
created_at | 2022-02-23 14:31:59.414657 |
updated_at | 2022-05-19 19:34:38.567101 |
description | A library for logging into a minecraft account by using the microsoft oauth2 device flow |
homepage | |
repository | https://github.com/comblock/ms_auth_mc |
max_upload_size | |
id | 537892 |
size | 27,725 |
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
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.