Documentation Index
Fetch the complete documentation index at: https://ona.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Available on the Enterprise plan. Contact sales to learn more.
Prerequisites
- Enable V3 tokens on the OIDC Token Configuration page in your organization settings. See Enable V3 tokens.
- Google Cloud CLI (
gcloud) installed in your environment.
How it works
- Ona issues a JWT with claims about the environment, user, and organization.
- The environment sends the JWT to Google’s Security Token Service (STS).
- STS validates the token against Ona’s OIDC discovery endpoint and returns a federated access token.
- The environment uses the federated token to access GCP resources directly, or impersonates a service account for broader access.
Step 1: Create a workload identity pool
Create a workload identity pool to manage Ona’s federated identities:Step 2: Create an OIDC provider
Add an OIDC provider to the pool that trusts Ona’s tokens:| Parameter | Description |
|---|---|
--issuer-uri | https://app.gitpod.io |
--allowed-audiences | The full provider resource name (used as the --audience in ona idp token) |
--attribute-mapping | Maps Ona token claims to GCP attributes |
--attribute-condition | CEL expression that restricts which tokens are accepted |
Attribute mappings
Attribute mappings define how Ona token claims map to GCP identity attributes.google.subject is required. Additional custom attributes enable fine-grained IAM bindings.
Common mappings for V3 tokens:
Attribute conditions
Attribute conditions restrict which tokens the provider accepts. Use CEL expressions to filter on Ona claims. Allow only a specific Ona organization:Step 3: Grant access to GCP resources
You can grant access using direct resource bindings or service account impersonation.Option A: Direct resource access
Grant the federated identity access directly on a GCP resource:attribute.project_id attribute:
Option B: Service account impersonation
If the GCP APIs you need do not support direct Workload Identity Federation, impersonate a service account instead.- Create a service account:
- Grant the federated identity permission to impersonate the service account:
- Grant the service account access to the resources it needs:
Step 4: Authenticate from an environment
Create a credential configuration file
Create a credential configuration file that tells the GCP SDK how to obtain tokens from Ona:--service-account flag:
Authenticate
Set theGOOGLE_APPLICATION_CREDENTIALS environment variable and enable executable-based credentials:
Automate on environment startup
Add the credential setup to your automations:Store the credential configuration file in your repository or generate it during environment startup. It does not contain secrets, only the configuration for how to obtain tokens.
Using V2 tokens with GCP
V2 tokens also work with GCP Workload Identity Federation. The V2sub claim uses a path-based format (e.g., org:<orgID>/prj:<projectID>/env:<envID>). Adjust your attribute mappings and conditions accordingly.
V2 tokens include fewer claims (org, gsub, and standard JWT fields), so attribute mappings are limited to google.subject=assertion.sub and conditions on assertion.sub or assertion.org. See the OIDC overview V2 section for the full V2 sub format reference.
Further reading
- GCP: Workload Identity Federation
- GCP: Configure Workload Identity Federation with OIDC providers
- GCP: Manage workload identity pools
- Ona OIDC overview
Troubleshooting
"The audience in the credential configuration does not match"
"The audience in the credential configuration does not match"
- The
--audienceinona idp tokenmust match the--allowed-audienceson the OIDC provider. Use the full provider resource name.
"The attribute condition was not met"
"The attribute condition was not met"
- Your token’s claims do not satisfy the
--attribute-conditionCEL expression. - Decode your token:
ona idp token --audience <AUDIENCE> --decode - Verify the
organization_id,project_id, or other claims match the condition.
"Permission denied on resource"
"Permission denied on resource"
- The federated identity or service account does not have the required IAM role on the target resource.
- Check the
--memberformat in your IAM binding. ForprincipalSet://, the attribute value must match exactly.
"Executable returned a non-zero exit code"
"Executable returned a non-zero exit code"
- The
ona idp tokencommand failed. Verify the CLI is installed and authenticated in the environment. - Check that the audience value is correct.