Skip to content

credctl setup gcp-oidc

Terminal window
credctl setup gcp-oidc [flags]

credctl setup gcp-oidc creates a Google Cloud Storage bucket and uploads OIDC discovery documents, providing an OIDC issuer URL without needing any AWS infrastructure.

This is the recommended approach for GCP-only users. The bucket is made publicly readable so that cloud providers (both GCP and AWS) can fetch the JWKS during credential exchange.

The issuer URL format is https://storage.googleapis.com/{bucket}.

If a GCP Workload Identity Federation provider already exists (from a previous credctl setup gcp), its issuer URL is automatically updated to point to the new GCS-hosted endpoint.

FlagTypeDefaultDescription
--bucketstringcredctl-oidc-{project}GCS bucket name.
--projectstringgcloud defaultGCP project ID. Defaults to the active gcloud configuration.
--regionstringus-central1GCS bucket location.
Terminal window
credctl setup gcp-oidc
Using GCP project: my-project
Creating GCS bucket 'credctl-oidc-my-project'...
Setting public read access...
Generating OIDC documents...
Uploading OIDC documents to GCS...
GCP OIDC setup complete.
Issuer URL: https://storage.googleapis.com/credctl-oidc-my-project
Bucket: gs://credctl-oidc-my-project
Next steps:
credctl setup gcp --service-account <email>
Terminal window
credctl setup gcp-oidc --bucket my-oidc-bucket --region europe-west1
Terminal window
credctl init
credctl setup gcp-oidc
credctl setup gcp --service-account credctl@my-project.iam.gserviceaccount.com
credctl setup gcp-cred-file
credctl auth --provider gcp

Cross-cloud: GCS-hosted OIDC for both GCP and AWS

Section titled “Cross-cloud: GCS-hosted OIDC for both GCP and AWS”
Terminal window
credctl setup gcp-oidc
credctl setup gcp --service-account credctl@my-project.iam.gserviceaccount.com
credctl setup aws --issuer-url https://storage.googleapis.com/credctl-oidc-my-project \
--policy-arn arn:aws:iam::123456789012:policy/MyPolicy
CodeMeaning
0GCS bucket created and OIDC documents uploaded
1Error (device not initialised, gcloud not found, permission denied, or other error)