Hi everyone,
I’m new to Google Cloud and I’ve run into an identity issue that I can’t explain.
I have what I believe is a single Google account. I normally log in using:
user@googlemail.com
If I try to sign in with:
user@gmail.com
Google automatically redirects me back to:
user@googlemail.com
which made me think they are simply aliases of the same account.
In Cloud Shell, gcloud auth list shows:
$ gcloud auth list
Credentialed Accounts
ACTIVE ACCOUNT
* user@googlemail.com
I then created a new project using the CLI:
gcloud projects create test-project
The project was created successfully.
However, when I looked at the project’s IAM page in the Google Cloud Console, the Owner of the project was:
user@gmail.com
instead of:
user@googlemail.com
Because of this, when I try to enable an API from Cloud Shell, I receive permission errors similar to:
gcloud services enable artifactregistry.googleapis.com
ERROR: PERMISSION_DENIED
This command is authenticated as user@googlemail.com
At this point I’m confused because:
gcloud auth listonly showsuser@googlemail.com- I created the project using the
gcloudCLI - The project’s Owner is
user@gmail.com - Logging in with
user@gmail.comalways redirects me touser@googlemail.com
My questions are:
- Is this expected behaviour for
gmail.comandgooglemail.comaliases in Google Cloud? - Does Google Cloud IAM treat these as different principals?
- If they are aliases of the same Google account, why does the project Owner appear as
user@gmail.comwhilegcloudauthenticates asuser@googlemail.com? - How can I ensure that the identity used by
gcloudmatches the identity that owns the project?
I’m trying to understand how Google Cloud handles identities rather than just finding a workaround.
Thanks in advance for any explanation.