I'm trying to read a JSON key file from Google Cloud Storage to authenticate. I have the following function:
storage_client = storage.Client()
bucket_name = 'bucket_name'
bucket = storage_client.get_bucket(bucket_name)
blob = bucket.get_blob('key.json')
json_data_string = blob.download_as_string()
credentials = ServiceAccountCredentials.from_json_keyfile_dict(
    json_data_string,
    scopes=['https://www.googleapis.com/auth/analytics',
            'https://www.googleapis.com/auth/analytics.edit'])
and the following error: AttributeError: 'bytes' object has no attribute 'get'
How should I read/format my key.json file to use it with ServiceAccountCredentials
 
    