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
- Cache auth information
- certs
- game_
profile - offline
- sessionserver
- Tell Mojang you’re joining a multiplayer server.
Structs§
- Access
Token Response - Auth
Opts - Auth
Result - Device
Code Response - Game
Ownership Item - Game
Ownership Response - Minecraft
Auth Response - Minecraft
Token Response - Profile
Response - Xbox
Live Auth - Just the important data
- Xbox
Live Auth Response
Enums§
- Auth
Error - Check
Ownership Error - GetMicrosoft
Auth Token Error - GetProfile
Error - Minecraft
Auth Error - Minecraft
Xsts Auth Error - Refresh
Microsoft Auth Token Error - Xbox
Live Auth Error
Functions§
- auth
- Authenticate with Microsoft. If the data isn’t cached, they’ll be asked to go to log into Microsoft in a web page.
- check_
ownership - get_
minecraft_ token - Authenticate with Minecraft when we already have a Microsoft auth token.
- get_
ms_ 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_
ms_ link_ code - Get the Microsoft link code that’s shown to the user for logging into Microsoft.
- get_
profile - interactive_
get_ ms_ auth_ token - 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. - refresh_
ms_ auth_ token