Skip to main content

Crate firebase_admin

Crate firebase_admin 

Source
Expand description

An open-source Firebase Admin SDK for Rust.

firebase-admin currently implements Firebase Authentication: verifying ID tokens, creating custom tokens, managing users, and session cookies. Support for additional Firebase services (Firestore, Cloud Storage, …) is planned; see ARCHITECTURE.md in the repository root for the project’s module and versioning conventions.

§Example

use firebase_admin::auth::AuthClient;

let auth = AuthClient::builder("my-project-id")
    .service_account_key(firebase_admin::core::ServiceAccountKey::from_file(
        "service-account.json",
    )?)
    .build()?;

let claims = auth.verify_id_token("<id-token-from-client>").await?;
println!("verified uid: {}", claims.sub);

Modules§

auth
Firebase Authentication: ID token verification, custom token creation, session cookies, and user management.
core
Cross-service functionality shared by every Firebase service module.

Enums§

Error
The top-level error type for firebase-admin.

Type Aliases§

Result
A Result alias using Error as its error type.