google_auth_verifier

Crates.iogoogle_auth_verifier
lib.rsgoogle_auth_verifier
version0.1.4
sourcesrc
created_at2024-07-01 08:33:17.657404
updated_at2024-07-02 06:41:17.996849
descriptionSmall library to quickly verify tokens provided by google auth
homepage
repositoryhttps://github.com/helloImHai/google_auth_verification
max_upload_size
id1288554
size48,850
Hai Nguyen (helloImHai)

documentation

README

Rust Google Authentication Library

A simple Rust library for verifying Google auth tokens.

Installation

Add this to your Cargo.toml:

[dependencies]
google-auth-verifier = "0.1.4"

Usage

use google_auth_verifier::AuthVerifierClient;

#[tokio::main]
async fn main() {
    // None for auth verifier options will use default options
    let mut auth_verifier_client = AuthVerifierClient::new(None);
    // verify_generic_token will work for both firebase and oauth tokens
    let res = auth_verifier_client.verify_generic_token("# insert key here").await;

    match res {
        Ok(token_info) => {
            println!("Token is valid: {:?}", token_info);
        },
        Err(e) => {
            eprintln!("Failed to verify token: {:?}", e);
        },
    }
}

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Acknowledgements

Commit count: 1

cargo fmt