You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the following code from python library:
def get_gcloud_oauth2_creds():
gcfp = '~/.config/gcloud/credentials'
credfn = os.path.expanduser(gcfp)
if not os.path.exists(credfn):
msg = "[edx2bigquery] Authentication error! You have specified USE_GCLOUD_AUTH in the configuration, but do not have gcloud authentication available.\n"
msg += " Please authenticate using 'gcloud auth login' before running this."
print msg
raise Exception(msg)
gcloud_cred = json.loads(open(credfn).read())['data'][0]['credential']
credentials = Credentials.new_from_json(json.dumps(gcloud_cred))
return credentials
I always hit the error since my gcloud auth login is creating its files in ~/.config/gcloud/legacy_credentials, which does not seem to work for me. Any ideas how to use the legacy_credentials or preferably get gcloud auth login to work?
The text was updated successfully, but these errors were encountered:
Hi @msj121, this library is for allowing applications to authenticate to Google and Google Cloud services. It is unrelated to the Cloud SDK's auth (except through a legacy mechanism).
@jonparrott Thanks that link finally got me to the exact link I was looking for. I have been searching/working on this for a week with different python approaches and different key files, but that document contained the link to the right json file. So I tried a different approach to connecting with it instead and now it works.
I described the issue on https://stackoverflow.com/questions/48088841/gcloud-auth-login-saves-to-legacy-credentials-folder
I am running the following code from python library:
I always hit the error since my
gcloud auth login
is creating its files in~/.config/gcloud/legacy_credentials
, which does not seem to work for me. Any ideas how to use the legacy_credentials or preferably get gcloud auth login to work?The text was updated successfully, but these errors were encountered: