| Crates.io | fire-auth-token |
| lib.rs | fire-auth-token |
| version | 0.1.3 |
| created_at | 2025-02-12 18:46:43.586808+00 |
| updated_at | 2025-02-16 08:29:41.413335+00 |
| description | Firebase Auth Token Verification Crate |
| homepage | https://github.com/ajkumar1205/fire-auth-token |
| repository | https://github.com/ajkumar1205/fire-auth-token |
| max_upload_size | |
| id | 1553274 |
| size | 58,525 |
A Rust library for verifying Firebase ID tokens. It handles token validation, public key caching, and automatic background public key refresh using async operations.
Add the package with Cargo:
[dependencies]
fire-auth-token = "0.1.2"
Or run
cargo add fire-auth-token
use fire_auth_token::FirebaseAuth;
#[tokio::main]
async fn main() {
let project_id = "your-project-id".to_string();
let auth = FirebaseAuth::new(project_id).await;
let token = "your-firebase-id-token";
// For regular Firebase tokens
let user = auth.verify_token::<FirebaseAuthUser>(token).await?;
// For Google Firebase tokens
let user = auth.verify_token::<FirebaseAuthGoogleUser>(token).await?;
}