triauth for Google CloudOIDC
Let your engineers open the Google Cloud console and use gcloud with one approval on their own device, through Workforce Identity Federation.
- Sign-in through
- OpenID Connect bridge
- Available in
- Any Google Cloud organization, at no charge
- Set up in
- gcloud iam workforce-pools
About Google Cloud
Google Cloud is Google's cloud platform. Workforce Identity Federation lets a company's staff open the Google Cloud console and use the gcloud command line with the company's own identity provider instead of Google accounts, with access granted through the usual IAM roles.
Connect Google Cloud to triauth
Google Cloud signs people in through the triauth OpenID Connect bridge, as the provider of a workforce identity pool. Once connected, your engineers open the console's sign-in link, type their username, and approve on their own device, and gcloud signs in through the same page. Nobody keeps a Google password, and when someone leaves, removing their identity records at your domain ends their access to Google Cloud as well.
How it works
Create a pool under your organization. Replace the organization ID with yours.
shgcloud iam workforce-pools create example-pool \ --organization=<your organization ID> --location=global \ --display-name="example.com" --session-duration=8hOpen oidc.triauth.org and enter your domain. Paste the redirect address,
https://auth.cloud.google/signin-callback/locations/global/workforcePools/example-pool/providers/triauth, and click Connect app. The bridge gives you a client ID and a client secret.Create the provider. Replace
example.comwith your domain and the two placeholders with the client ID and the client secret from the bridge.shgcloud iam workforce-pools providers create-oidc triauth \ --workforce-pool=example-pool --location=global \ --display-name="example.com" \ --issuer-uri="https://oidc.triauth.org/example.com" \ --client-id="<client ID from the bridge>" \ --client-secret-value="<client secret from the bridge>" \ --web-sso-response-type="code" \ --web-sso-assertion-claims-behavior="only-id-token-claims" \ --web-sso-additional-scopes="groups" \ --attribute-mapping="google.subject=assertion.sub,google.display_name=assertion.name,google.groups=assertion.groups"Grant roles to a group published at your domain, here the group
cloud-team@example.comon one project:shgcloud projects add-iam-policy-binding <your project> --role=roles/viewer \ --member="principalSet://iam.googleapis.com/locations/global/workforcePools/example-pool/group/cloud-team@example.com"Open
https://auth.cloud.google/signin/locations/global/workforcePools/example-pool/providers/triauth?continueUrl=https://console.cloud.google/, or give gcloud a login configuration withgcloud iam workforce-pools create-login-configand rungcloud auth login --login-config=login.json.
Checkpoint
The sign-in link opens a page from the bridge that asks for the username, and the engineer's authenticator asks them to approve. The federated console then opens with the projects their roles allow.
Good to know
- Google Cloud creates no accounts. A person is a principal of the pool, and gets exactly the IAM roles granted to them or to their groups published at your domain. To let only one team in, limit the app to a group when you connect it.
- A session lasts between fifteen minutes and twelve hours, eight in the example, and then the person signs in again. The bridge is not asked to renew anything.
- The federated console shows the Google Cloud products that support Workforce Identity Federation, which is most of them, not the whole console.
For the person who connects the app
| Setting | Value |
|---|---|
| Redirect address | https://auth.cloud.google/signin-callback/locations/global/workforcePools/<pool>/providers/<provider>, one for the console and for gcloud's browser sign-in |
| Where | gcloud iam workforce-pools, or IAM & Admin › Workforce Identity Pools in the console. An organization resource and the Workforce Pool Admin role are required |
| Issuer | --issuer-uri takes https://oidc.triauth.org/<your domain>. Google's own example issuer carries a path |
| Scopes and claims | openid profile email by default, groups added above. The bridge puts every claim in the ID token, so the claims behaviour only-id-token-claims is enough |
| Mapping | google.subject is the identifier, google.display_name the name, google.groups the groups. Sign-in fails for a person in more than 400 groups |
Google Cloud keeps the client secret, so leave This app can't keep a secret unticked when you connect it on the bridge. Google's Workforce Identity Federation guide explains every flag, and the console access page the sign-in link.
Next steps
- Read the OpenID Connect bridge page for what every connected app gets and what the bridge keeps private.
- Read Roll out to your team to give everyone in your organization an identifier at your domain.
- Read Groups to publish the groups that IAM roles are granted to.
- Read Google's Workforce Identity Federation guide for every setting Google Cloud offers.
All logos and trademarks belong to their respective owners and do not imply affiliation or endorsement of the organization or product by triauth, nor vice versa. The content provided on this page may include information from third-party sources. We do not assume any responsibility for the completeness, correctness, or applicability of the information. You should independently verify any details before relying on them.