Last active
May 28, 2019 10:29
-
-
Save sudam-chavan/5e90e9728729e50ed7e50a62f3ce4e7b to your computer and use it in GitHub Desktop.
Print firebase access token for remote config scope
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### | |
# | |
# 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