Skip to content

Instantly share code, notes, and snippets.

@sudam-chavan
Last active May 28, 2019 10:29
Show Gist options
  • Save sudam-chavan/5e90e9728729e50ed7e50a62f3ce4e7b to your computer and use it in GitHub Desktop.
Save sudam-chavan/5e90e9728729e50ed7e50a62f3ce4e7b to your computer and use it in GitHub Desktop.
Print firebase access token for remote config scope
###
#
# install oauth2client before running
# pip3 install --upgrade oauth2client or pip install --upgrade oauth2client
#
###
from oauth2client.service_account import ServiceAccountCredentials
import sys
if(len(sys.argv) == 1):
print 'Usage: print.py <private key json file>'
sys.exit(1)
privatekeyfile = sys.argv[1]
scopes = ["https://www.googleapis.com/auth/firebase.remoteconfig"]
credentials = ServiceAccountCredentials.from_json_keyfile_name(privatekeyfile, scopes=scopes)
access_token_info = credentials.get_access_token()
print("Access token: " + access_token_info.access_token)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment