From 13ce3e8f9b0818776d9fd74178cb706ea24e05b9 Mon Sep 17 00:00:00 2001 From: mjeremia Date: Sat, 10 Jan 2026 14:41:55 -0500 Subject: [PATCH 1/2] Update get_service_account_tokens.py Improved comment to clarify what users should do when the access token expires. Access tokens are short lived; once they expire, a new token must be generated by rerunning this code. This improves clarity for beginners using the Firebase Admin SDK. --- snippets/auth/get_service_account_tokens.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/snippets/auth/get_service_account_tokens.py b/snippets/auth/get_service_account_tokens.py index 7ad67a09..34480b18 100644 --- a/snippets/auth/get_service_account_tokens.py +++ b/snippets/auth/get_service_account_tokens.py @@ -23,7 +23,9 @@ access_token = access_token_info.access_token expiration_time = access_token_info.expiry # Attach access_token to HTTPS request in the "Authorization: Bearer" header -# After expiration_time, you must generate a new access token +# Access tokens are short lived +# Once the token reaches the expiration time, it can no longer be used. +# To get a new token, rerun this code to generate a fresh acccess token # [END get_service_account_tokens] print(f'The access token {access_token} expires at {expiration_time}') From bc8792144f608793c19137e8e3f5e002ca4ff97e Mon Sep 17 00:00:00 2001 From: mjeremia Date: Thu, 15 Jan 2026 23:22:07 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- snippets/auth/get_service_account_tokens.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/auth/get_service_account_tokens.py b/snippets/auth/get_service_account_tokens.py index 34480b18..d550303c 100644 --- a/snippets/auth/get_service_account_tokens.py +++ b/snippets/auth/get_service_account_tokens.py @@ -25,7 +25,7 @@ # Attach access_token to HTTPS request in the "Authorization: Bearer" header # Access tokens are short lived # Once the token reaches the expiration time, it can no longer be used. -# To get a new token, rerun this code to generate a fresh acccess token +# To get a new token, rerun this code to generate a fresh access token # [END get_service_account_tokens] print(f'The access token {access_token} expires at {expiration_time}')