Skip to content

Commit 13ce3e8

Browse files
authored
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.
1 parent d5aba84 commit 13ce3e8

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

snippets/auth/get_service_account_tokens.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@
2323
access_token = access_token_info.access_token
2424
expiration_time = access_token_info.expiry
2525
# Attach access_token to HTTPS request in the "Authorization: Bearer" header
26-
# After expiration_time, you must generate a new access token
26+
# Access tokens are short lived
27+
# Once the token reaches the expiration time, it can no longer be used.
28+
# To get a new token, rerun this code to generate a fresh acccess token
2729
# [END get_service_account_tokens]
2830

2931
print(f'The access token {access_token} expires at {expiration_time}')

0 commit comments

Comments
 (0)