All Tools View Categories About Contact Privacy

Federated Identity Policy Generator

Build a SAML or OIDC trust policy with correctly derived audience/subject condition keys — including GitHub Actions-style OIDC.

Runs entirely in your browser — provider ARNs and claim values never leave this page.
-
action
-
derived hostname
0
conditions
-
structurally valid

  

About Federated Identity Policy Generator

SAML and OIDC federated trust policies share the same overall shape as any other IAM trust policy — a Principal naming the identity provider, and no Resource — but they add a layer most trust-policy tooling glosses over: condition keys whose exact name depends on which specific provider issued the token. Federated Identity Policy Generator is built specifically around that detail, going further than the generic IAM Trust Policy Generator's federated option, which only handles the Principal and the SAML/OIDC action branch.

Pick an identity type, SAML or OIDC, and supply the provider's ARN — for SAML, something like arn:aws:iam::123456789012:saml-provider/CorpOkta; for OIDC, something like arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com. The action is set automatically from the identity type rather than asked as a separate question, because it is not really an independent choice: SAML federation always uses sts:AssumeRoleWithSAML, and OIDC federation always uses sts:AssumeRoleWithWebIdentity.

The part that actually differs meaningfully by provider is the condition block, and this is where the tool does real work rather than cosmetic labeling. SAML has one fixed, provider-agnostic condition key for the assertion's audience claim: SAML:aud, typically restricted to https://signin.aws.amazon.com/saml for console federation. OIDC does not have a fixed key at all — because AWS supports many independent OIDC providers issuing tokens with their own claim namespaces, every OIDC condition key must be prefixed with that specific provider's own hostname, giving keys like token.actions.githubusercontent.com:aud and token.actions.githubusercontent.com:sub. Typing that hostname by hand a second time, separately from the provider ARN you already entered, is exactly the kind of manual step that drifts out of sync — a typo in the hostname portion of a condition key means the condition simply never matches, and the trust policy silently fails to work as intended. This tool eliminates that risk structurally: it parses the OIDC provider ARN you supplied, extracts the hostname from the part after oidc-provider/, and uses that extracted value to build both the audience and subject condition keys, so they can never diverge from the provider ARN itself.

The audience and subject fields are both optional in the form, but leaving them empty in a real trust policy is a meaningful security decision, not a convenience default: without a subject restriction, any workload the identity provider will issue a token for can potentially assume the role, not just the one you intended. The worked example this tool leads with — GitHub Actions OIDC — makes the stakes concrete: restricting the sub claim to repo:my-org/my-repo:ref:refs/heads/main means only workflow runs from that exact repository and branch can assume the role, versus leaving it unset and trusting every GitHub Actions workflow anywhere that can obtain a token from GitHub's OIDC provider for your account.

As with any trust policy, Resource is deliberately absent — the role being assumed is the implicit resource, and the statement builder's default wildcard Resource is actively removed after the statement is assembled, the same approach used by the general-purpose Trust Policy Generator. Validation is structural only: the provider ARN is checked for well-formedness, and for OIDC specifically, that it actually has the oidc-provider/ shape the hostname-extraction logic depends on. This tool cannot confirm the identity provider is actually registered in IAM, that the audience/subject values match what the provider really issues, or that the SAML/OIDC integration is otherwise correctly configured outside of this one trust statement. Everything — ARN parsing, hostname extraction, condition assembly, and validation — runs locally in your browser.

Features

  • SAML and OIDC identity types, each with the correct fixed or provider-namespaced condition keys.
  • OIDC hostname derived automatically from the provider ARN — never re-typed, never drifts.
  • Action set automatically from identity type — AssumeRoleWithSAML or AssumeRoleWithWebIdentity.
  • Dedicated audience/subject fields, more specific than the generic Trust Policy Generator's federated branch.
  • Real GitHub Actions OIDC worked example restricting by repo and branch.
  • Resource field correctly omitted, matching real trust-policy shape.
  • Provider ARN validated, including the OIDC oidc-provider/ resource-type check.
  • Structural policy validation before you copy the result.
  • Copy as JSON and Download .json.
  • 100% client-side — provider ARNs and claim values never leave the page.

How to Use

  1. Choose SAML or OIDC.
  2. Enter the identity provider ARN.
  3. Enter the audience (SAML: SAML:aud; OIDC: <hostname>:aud).
  4. For OIDC, enter the subject claim to restrict which caller can assume the role.
  5. Click Build trust statement.
  6. Check the derived hostname and condition keys shown in the stat cards.
  7. Copy or download the JSON.
  8. Attach it as the role's trust relationship in IAM.

Examples

Example 1 — GitHub Actions OIDC, one repo/branch. Identity type OIDC, provider arn:aws:iam::123456789012:oidc-provider/token.actions.githubusercontent.com, audience sts.amazonaws.com, subject repo:my-org/my-repo:ref:refs/heads/main — restricts assumption to that exact repository and branch.

Example 2 — workforce SSO via SAML. Identity type SAML, provider arn:aws:iam::123456789012:saml-provider/CorpOkta, audience https://signin.aws.amazon.com/saml — the standard shape for AWS Console federation via an on-prem or cloud SAML IdP.

Example 3 — GitLab CI OIDC. Identity type OIDC, provider arn:aws:iam::123456789012:oidc-provider/gitlab.com, subject project_path:my-group/my-project:ref_type:branch:ref:main — the hostname gitlab.com is derived automatically for the condition key.

Example 4 — Google Workspace SAML. Identity type SAML, provider arn:aws:iam::123456789012:saml-provider/GoogleWorkspace, audience left blank — produces a Principal-only statement with no audience restriction (the tool notes this is a real security decision, not a safe default).

Example 5 — malformed OIDC ARN caught. Entering a saml-provider/ ARN while Identity type is set to OIDC produces a specific validation error, since the hostname-extraction logic requires an oidc-provider/ resource type.

Benefits

  • Eliminates hostname drift in OIDC condition keys by deriving them from the provider ARN.
  • More specific than the generic Trust Policy Generator's federated option for real SAML/OIDC condition-key work.
  • Correct action and condition-key shape for both SAML and OIDC without memorizing AWS's claim-key conventions.
  • Concrete GitHub Actions example covering a genuinely common real-world setup.
  • Structural validation, including OIDC ARN shape, before you attach the policy.
  • Private — provider ARNs and claim values never leave your browser.

Frequently Asked Questions

How is this different from the Federated option in the generic IAM Trust Policy Generator?
The generic Trust Policy Generator's Federated branch only sets <code>Principal:{Federated:...}</code> and picks the right action (SAML vs OIDC) — it does not build the audience/subject condition keys, which is where SAML and OIDC federated trust policies get genuinely fiddly. This tool is specifically for that: it derives OIDC's hostname-namespaced condition keys automatically and gives dedicated audience/subject fields for both SAML and OIDC, rather than a generic External ID/MFA pair.
Why are the OIDC condition keys namespaced by hostname instead of a fixed name like SAML's "SAML:aud"?
Because AWS supports many different OIDC providers (GitHub Actions, GitLab, Google, Auth0, a self-hosted Kubernetes OIDC issuer, etc.), and the claims each one presents need their own namespace to avoid collisions — so AWS requires the condition key to be prefixed with that specific provider's own hostname, e.g. <code>token.actions.githubusercontent.com:sub</code>. SAML has exactly one fixed provider-agnostic key, <code>SAML:aud</code>, because the SAML assertion audience claim works the same way regardless of which SAML IdP issued it.
How does the tool get the hostname right without me typing it twice?
It parses the OIDC provider ARN you already entered — <code>arn:aws:iam::ACCOUNT:oidc-provider/<hostname></code> — and extracts the hostname from the resource part after <code>oidc-provider/</code>. That extracted hostname is what gets prefixed onto <code>:aud</code> and <code>:sub</code>, so the condition keys can never drift out of sync with the provider ARN you actually configured.
What is the GitHub Actions OIDC example about?
It is one of the most common real-world uses of this pattern: a GitHub Actions workflow authenticates to AWS via GitHub's own OIDC provider, and the trust policy restricts which repository (and often which branch or tag) is allowed to assume the role using the <code>sub</code> claim, e.g. <code>repo:my-org/my-repo:ref:refs/heads/main</code> — meaning only workflow runs from that exact repo and branch can assume the role, not every GitHub Actions workflow in existence.
Why does a federated trust statement have no "Resource" field?
Same reason as any trust policy — it is attached to the role being assumed, and the role itself is the implicit resource. AWS trust policies use <code>Principal</code> (here, <code>{"Federated": "<provider ARN>"}</code>) in place of a Resource. This tool actively deletes the default Resource the underlying statement builder would otherwise add.
Are the audience and subject fields required?
Audience and subject are both optional in the tool, but omitting them in a real trust policy is a real security decision, not a convenience: without an audience or subject restriction, any workload the provider can issue a token for can potentially assume the role. In practice, always set at least a subject restriction for OIDC and an audience restriction for SAML.
Does this tool verify that my OIDC provider or SAML provider is actually registered in IAM?
No — it only checks that the ARN you entered is structurally well-formed and, for OIDC, that it has the expected <code>oidc-provider/<hostname></code> shape. It does not call AWS to confirm the identity provider actually exists or is actually configured that way.
Can I use operators other than StringEquals for the audience/subject conditions?
This tool always uses <code>StringEquals</code> for both, matching the standard pattern AWS documents for these providers. For branch-wildcard patterns (e.g. any branch under <code>refs/heads/</code>) you would need <code>StringLike</code> instead, which is not built by this tool — edit the Condition operator by hand in the output if you need that.
Is my provider ARN or subject claim sent anywhere?
No — ARN parsing, hostname extraction, condition building and validation all run locally in your browser.
Can I export the result?
Yes, Copy as JSON and Download .json appear once the trust statement is built.