File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Getting started
1515
16161 . [ Add Firebase to your Android Project] ( https://firebase.google.com/docs/android/setup ) .
17172 . Create a service account as described in [ Adding Firebase to your Server] ( https://firebase.google.com/docs/admin/setup ) and download the JSON file.
18- - Copy the private key JSON file to this folder and rename it to ` service-account.json ` .
18+ - Set ` GOOGLE_APPLICATION_CREDENTIALS ` environment variable to path of downloaded credential file .
19193 . Change the ` PROJECT_ID ` variable in ` configure.py ` to your project ID.
2020
2121Run
Original file line number Diff line number Diff line change 1515def _get_access_token ():
1616 """Retrieve a valid access token that can be used to authorize requests.
1717
18+ This method assumes it is either running in a trusted Google environment like GCP or if running
19+ elsewhere the the GOOGLE_APPLICATION_CREDENTIALS environment variable is set to the path of the
20+ service account credentials file.
21+
1822 :return: Access token.
1923 """
20- credentials = ServiceAccountCredentials .from_json_keyfile_name (
21- 'service-account.json' , SCOPES )
24+ credentials = ServiceAccountCredentials .get_application_default ().create_scoped (scopes = SCOPES )
2225 access_token_info = credentials .get_access_token ()
2326 return access_token_info .access_token
2427# [END retrieve_access_token]
You can’t perform that action at this time.
0 commit comments