0

I have two separate google cloud accounts. I access/view some services that are currently only editable via the browser (not supported in the google-cloud api).

In order to that, I have to 1) login to account 1 and view/edit services 2) Logout, and then again repeat step 1 for account 2

This is quite cumbersome. Now, google-cloud normally supports storing credentials for two separate accounts. But is there a way to login via the browser using these stored credentials.

To clarify, I'm talking of logging in generically to a google account without using stuff like selenium+chromedriver. I'd prefer if some sort of stored credentials could be used. In my use case, convenience (and speed of login/logout) matters somewhat more than security.

Is there a way to do this using python or some other language?

Cœur
  • 37,241
  • 25
  • 195
  • 267
grill05
  • 171
  • 14
  • 3
    You want to **automate** your login process for google accounts ? – Muhammad Usman Bashir Nov 11 '19 at 11:52
  • exactly. Instead of choosing an account in the account manager login page, and then entering password. I know this can be done via selenium+chromedriver, but I want to do it via stored credentials, since I hope that would be faster/less cumbersome – grill05 Nov 11 '19 at 11:55
  • 1
    You can *either* go with **Beautiful-soup** as here: https://stackoverflow.com/questions/39540479/log-into-google-account-using-python *or* you can do this using **urllib** as follows : https://stackoverflow.com/questions/6754709/logging-in-to-google-using-python. – Muhammad Usman Bashir Nov 11 '19 at 12:00
  • Have you considered using the same login account for both GCP accounts? Then you do not need to switch. You can have more than one Google Identity access more than one GCP account (project/organization). – John Hanley Nov 11 '19 at 15:41

1 Answers1

1

You can sign in to multiple Google accounts at once in browser.

If you have more than one Google Account, you can sign in to multiple accounts at once. That way, you can switch between accounts without signing out and back in again.

For more details check Sign in to multiple accounts at once

If you want to do this for gcloud (not browser) check gcloud config configurations

Mahesh Khond
  • 1,297
  • 1
  • 14
  • 31