> ## Documentation Index
> Fetch the complete documentation index at: https://www.c1.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up workload federation

> Walk through the federation wizard to create a provider and trust, then test your token.

This guide walks through the C1 federation wizard to create a provider and trust. Before starting, you need a service principal -- if you don't have one yet, follow Step 1 of the [client credentials quick start](https://www.c1.ai/docs/product/admin/service-principals/client-credentials.md#step-1-create-a-service-principal). You don't need to create a credential; federation replaces credentials with OIDC tokens.

## Create a federation trust

**Step 1**

Navigate to **Identities** > **Service principals** and select your service principal.

**Step 2**

On the service principal detail page, select the **Federation** tab.

**Step 3**

Click **Setup federation**.

**Step 4**

Next, choose a provider. Select an existing provider, or create a new one. C1 includes presets for common platforms:

| Provider | Issuer URL | Notes |
| :- | :- | :- |
| **GitHub Actions** | `https://token.actions.githubusercontent.com` | Fixed issuer URL |
| **GitLab CI/CD** | `https://gitlab.com` (or self-managed URL) | Editable issuer URL |
| **HCP Terraform** | `https://app.terraform.io` (or custom hostname) | Editable issuer URL |
| **AWS IAM Outbound** | Account-specific issuer URL | Editable issuer URL |
| **SPIFFE** | Your trust domain's SPIFFE bundle endpoint | For SPIFFE/SPIRE workload identities |
| **Custom OIDC** | Any HTTPS issuer URL | For other OIDC-capable platforms |

**Step 5**

Configure the trust. For every provider except Custom OIDC, the wizard collects structured fields (organization, repository, branch, environment, and so on) and generates a CEL expression based on your inputs. You can switch to manual mode to write your own CEL expression. Custom OIDC has no structured fields -- you write the CEL expression directly.

**Optional.** Add IP restrictions and scoped roles for additional security. See [security controls](https://www.c1.ai/docs/product/admin/service-principals/security.md) for details.

**Step 6**

Click **Create trust** to finish.

**Step 7**

Copy the **client ID** -- you'll need it in your CI/CD configuration.

## Test your token

Before deploying to production, test the federation trust to make sure your CEL expression matches the expected JWT claims.

**Step 1**

Click the trust in the **Federation** tab to open its detail drawer, then click **Test**.

**Step 2**

Paste a sample JWT from your CI/CD platform, or provide claims as JSON.

**Step 3**

The test runner validates each step:

| Step | What it checks |
| :- | :- |
| JWT decode | Token is valid JWT format |
| Issuer match | Token issuer matches the provider |
| Signature validation | Token signature is valid via JWKS |
| Audience validation | Token audience matches your tenant |
| Token freshness | Token was issued within the last 10 minutes |
| CEL evaluation | Your condition expression returns `true` |
| IP address check | Source IP is in the allowlist (if configured) |

## Platform-specific guides

Once your trust is created, follow the integration guide for your CI/CD platform:

* [GitHub Actions](https://www.c1.ai/docs/product/admin/service-principals/github-actions.md) -- recommended for GitHub-based workflows
* [GitLab CI](https://www.c1.ai/docs/product/admin/service-principals/gitlab-ci.md) -- uses GitLab's built-in `id_tokens`
* [HCP Terraform](https://www.c1.ai/docs/product/admin/service-principals/hcp-terraform.md) -- auto-detected from workspace identity tokens
* [AWS IAM](https://www.c1.ai/docs/product/admin/service-principals/aws-iam.md) -- outbound identity federation from any AWS workload
* [SPIFFE](https://www.c1.ai/docs/product/admin/service-principals/spiffe.md) -- SPIFFE/SPIRE workload identities via JWT-SVID
* [Custom OIDC](https://www.c1.ai/docs/product/admin/service-principals/custom-oidc.md) -- any platform with OIDC support
