How can ı connect google cloud storage from Colab with different mail - authentication

I connect google cloud storage from Colab with this code
from google.colab import auth
auth.authenticate_user()
When I use it in this way, the mail I use Colab and the GCP mail must be the same. But I am connecting via a different email. And I am getting error like this.
How can I connect to Cloud Storage with Colab session not having same mail as GCP?

Related

How to view and edit mounted gdrive files in gspread format without authentication on google colab?

I have mounted the google drive using the in-built function on google colab.
According to google, this means that the files should act as if they were accessible and editable from the local directory.
However, file = open("file path", "r+") leads to "AttributeError: module 'gspread' has no attribute 'open'".
How do you open and edit these gspread files without further authentication beyond the automatic authentication of mounting gspread (i.e, not using the gc.open_by_url() approach)?

How to download files generated in Colab to dropbox directly?

I am training a model on Google Collaboratory. Is it possible to download it directly into my dropbox account (similar to how we write directly into the mounted Google Drive)?

Does using Google Colaboratory give Google access to my code?

I was wondering what the privacy and security settings were for Google Colaboratory. I know Google Drive gives Google access to all your files, is it the same for google Colaboratory? Any insight on this would be great.
The sixth question and answer in the FAQ (https://research.google.com/colaboratory/faq.html) says that "All Colaboratory notebooks are stored in Google Drive". So if Google has "access" to all your google drive docs, by extension it also has access to your notebooks.

Running Google EarthEngine API on Google Colaboratory notebook

I would like to install and use Google EarthEngine's Python API in a Google Colaboratory notebook. And I haven't gotten very far with that at all. After I type the following code into a cell,
!pip install earthengine-api
!earthengine authenticate
the earthengine-api and its dependencies install, but the authentication requires me to log into my account and to enter an authorization code (which then, presumably, stores OAuth credentials locally) and enables use of this API subsequently via ee.Initialize().
I have two issues:
In the Colaboratory interface, which does not have a command line kind of interactivity, I am unable to enter the authorization code that EarthEngine needs to authenticate. Is there any workaround?
Where, if at all I got around the issue above, would the OAuth credentials be stored? Would this be per-session, or per-user? And would it be accessible to this or other notebooks in subsequent sessions, or in different notebooks?
I have found an example here. It uses --quiet
https://github.com/google/earthengine-api/blob/master/python/examples/ipynb/authorize_notebook_server.ipynb

Download files from a specific user's drive with google drive api

Is there a way to download files from a specific google drive, by using the google drive api? Currently i can only read the drive of the google user logged in.
Inorder to access data owned by someone on Google drive you need their permission. You can't just access my files unless I let you. The most common method for this is oauth2 but you can also use a service account.
Now if I set a file to public you would be able to read it using an API key but I would have to give you the file id.