{"id":16594620,"url":"https://github.com/antonybudianto/firebase-rs","last_synced_at":"2025-10-29T12:30:25.443Z","repository":{"id":65174494,"uuid":"585577024","full_name":"antonybudianto/firebase-rs","owner":"antonybudianto","description":"Firebase JWT Rust package. Small utility to decode your Firebase client token in Rust","archived":false,"fork":false,"pushed_at":"2023-01-06T05:49:29.000Z","size":20,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-13T23:10:26.303Z","etag":null,"topics":["firebase","jwt","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/firebase_jwt_rs","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antonybudianto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-05T14:25:20.000Z","updated_at":"2023-07-27T23:24:01.000Z","dependencies_parsed_at":"2023-01-13T15:52:13.486Z","dependency_job_id":null,"html_url":"https://github.com/antonybudianto/firebase-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"antonybudianto/rust-starter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Ffirebase-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Ffirebase-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Ffirebase-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Ffirebase-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonybudianto","download_url":"https://codeload.github.com/antonybudianto/firebase-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219857801,"owners_count":16556055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","jwt","rust"],"created_at":"2024-10-11T23:46:50.319Z","updated_at":"2025-10-29T12:30:25.049Z","avatar_url":"https://github.com/antonybudianto.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firebase-jwt-rs\n\nFirebase JWT decoding utility for Rust.\n\n\u003cimg width=\"1027\" alt=\"Screen Shot 2023-01-05 at 11 03 13 PM\" src=\"https://user-images.githubusercontent.com/7658554/210826111-2ca13e44-7ea0-4b14-8535-60564ee10c7c.png\"\u003e\n\n## What is this?\n\nIf you have a Rust server and plan to have API for verifying your firebase users' [client token](https://firebase.google.com/docs/auth/admin/verify-id-tokens#retrieve_id_tokens_on_clients), then it's just for you!\n\nIt only contains small utility to decode your [client token](https://firebase.google.com/docs/auth/admin/verify-id-tokens#retrieve_id_tokens_on_clients).\n\n**Read more:**\n\nhttps://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library\n\n## Flow\n\n1. In your frontend, you can get your uid + client-token by using Firebase Client SDK.\n\n    Sample:\n    https://firebase.google.com/docs/auth/admin/verify-id-tokens#retrieve_id_tokens_on_clients\n\n2. Then your frontend can hit the backend Rust API and send over uid+client-token to the HTTP Header/POST body (up to you), which will be passed to `verify_token(uid, client_token)` util.\n\n3. Add `FIREBASE_PROJECT_ID` environment variable to your backend on local and production server\n\n4. Backend Rust will verify and send back the JWT claim response (including extracted user's data, and verified user_id) back as json\n\n## How to use\n\n```rs\nuse firebase_jwt_rs::*;\nuse jsonwebtoken::TokenData;\nuse std::error::Error;\n\nlet uid = \"your-user-uid\";\nlet client_token = \"your-client-token\";\n\nlet result: Result\u003cTokenData\u003cClaims\u003e, Box\u003cdyn Error\u003e\u003e = verify_token(uid, client_token).await;\n\nmatch result {\n  Ok(res: TokenData\u003cClaims\u003e) =\u003e {\n    let text: String = serde_json::to_string(\u0026res.claims).unwrap();\n    println!(\"result:{text}\");\n  }\n  Err(e) =\u003e {\n    println!(\"err:{e}\");\n  }\n}\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonybudianto%2Ffirebase-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonybudianto%2Ffirebase-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonybudianto%2Ffirebase-rs/lists"}