Expand description
§Azalea Auth
A port of Mojang’s Authlib and launcher authentication.
§Examples
use std::path::PathBuf;
#[tokio::main]
async fn main() {
let cache_file = PathBuf::from("example_cache.json");
let auth_result = azalea_auth::auth(
"[email protected]",
azalea_auth::AuthOpts {
cache_file: Some(cache_file),
..Default::default()
},
)
.await
.unwrap();
println!("{auth_result:?}");
}
Thanks to wiki.vg contributors, Overhash, and prismarine-auth contributors.
Modules§
- Cache auth information
- Tell Mojang you’re joining a multiplayer server.
Structs§
- Just the important data
Enums§
Functions§
- Authenticate with Microsoft. If the data isn’t cached, they’ll be asked to go to log into Microsoft in a web page.
- Authenticate with Minecraft when we already have a Microsoft auth token.
- Wait until the user logged into Microsoft with the given code. You get the device code response needed for this function from
get_ms_link_code
. - Get the Microsoft link code that’s shown to the user for logging into Microsoft.
- Asks the user to go to a webpage and log in with Microsoft. If you need to access the code, then use
get_ms_link_code
and thenget_ms_auth_token
instead.