1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00
azalea/azalea-auth
2025-06-16 04:12:22 +04:00
..
examples remove executable bit from files 2025-04-04 15:56:06 +00:00
src formatting: merge imports 2025-05-30 14:44:48 -13:00
Cargo.toml put all azalea-* deps in the workspace Cargo.toml 2025-06-16 04:12:22 +04:00
README.md doc updates 2025-05-31 23:14:59 -06:00

Azalea Auth

A port of Mojang's Authlib and launcher authentication.

The default location of Azalea's cache is at ~/.minecraft/azalea-auth.json. You can delete or modify this file if you'd like to associate an email with a different account.

Examples

use std::path::PathBuf;

#[tokio::main]
async fn main() {
    let cache_file = PathBuf::from("example_cache.json");

    let auth_result = azalea_auth::auth(
        "example@example.com",
        azalea_auth::AuthOpts {
            cache_file: Some(cache_file),
            ..Default::default()
        },
    )
    .await
    .unwrap();
    println!("{auth_result:?}");
}

Thanks to wiki contributors, Overhash, and prismarine-auth contributors.