0Pricing
AWS Security Academy · Lesson

SAML, OIDC, and Web Identity Federation

Connect external identity providers and app logins to AWS.

SAML, OIDC, and Web Identity Federation is a free AWS Security Academy lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AWS Security Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Federation Means

Federation lets identities defined outside AWS sign in and receive AWS permissions without ever having an IAM user.

An external identity provider (IdP) vouches for the user, and AWS trusts that assertion to issue temporary credentials. This avoids duplicating accounts and keeps the source of truth in your existing directory.

SAML 2.0 Federation

SAML (Security Assertion Markup Language) 2.0 is the classic standard for enterprise federation.

  • You register the IdP in IAM as a SAML identity provider.
  • The IdP sends a signed assertion after the user logs in.
  • AWS exchanges it via STS for temporary role credentials.

It is common with Active Directory Federation Services and similar corporate IdPs.

OIDC Federation

OIDC (OpenID Connect) is a modern token-based standard built on OAuth 2.0.

It is ideal for federating workloads and CI/CD systems. For example, a GitHub Actions pipeline can present an OIDC token, and AWS assumes a role with no stored keys. You register the provider as an IAM OIDC identity provider.

Web Identity Federation

Web identity federation lets users sign in with a public provider such as Google, Facebook, or Amazon, common in mobile and web apps.

The app passes the provider's token to STS via AssumeRoleWithWebIdentity, receiving temporary credentials scoped to a role. Users never need an IAM identity.

The Role of STS

All federation paths converge on STS (Security Token Service). STS exchanges a verified external assertion for short-lived AWS credentials tied to an IAM role.

  • SAML uses AssumeRoleWithSAML.
  • OIDC and web identity use AssumeRoleWithWebIdentity.

The role's permissions define what the federated user can do.

Trust Policies for Federation

The IAM role a federated user assumes has a trust policy naming the IdP as the principal.

Conditions in the trust policy restrict who from that provider may assume the role, for example matching a specific SAML attribute or an OIDC sub claim. This keeps a broad provider from granting access to everyone.

{
  "Effect": "Allow",
  "Principal": { "Federated": "arn:aws:iam::111122223333:oidc-provider/token.actions.githubusercontent.com" },
  "Action": "sts:AssumeRoleWithWebIdentity",
  "Condition": { "StringLike": { "token.actions.githubusercontent.com:sub": "repo:my-org/my-repo:*" } }
}

Identity Center vs Raw Federation

IAM Identity Center is itself a federation layer for the workforce, with a polished portal and permission sets.

Raw IAM SAML or OIDC providers are lower-level building blocks better suited to application and workload federation or legacy setups. The exam expects you to pick Identity Center for human SSO and OIDC roles for pipelines.

Amazon Cognito Identity Pools

For consumer-facing apps, Amazon Cognito identity pools brokers web identity federation for you.

It exchanges social or user-pool logins for temporary AWS credentials, handling the STS calls behind the scenes. This is the recommended path for mobile apps rather than calling AssumeRoleWithWebIdentity directly.

Avoiding Embedded Keys

The whole point of federation is to stop embedding long-term keys in apps, pipelines, and devices.

  • Leaked static keys are a top breach cause.
  • Federated tokens are short-lived and tied to a verified identity.

If you see hardcoded access keys in a scenario, federation is usually the fix.

Choosing the Right Standard

Match the standard to the source:

  • SAML for traditional enterprise IdPs and AD.
  • OIDC for modern workloads and CI/CD.
  • Web identity / Cognito for public app users.

All deliver temporary credentials, differing mainly in token format and use case.

Auditing Federated Access

Federated sessions appear in CloudTrail with the assumed-role identity and the federation event.

You can trace which IdP and which external user triggered an action, preserving accountability even though no IAM user exists. Consistent role naming makes these logs far easier to read.

Quick Check

Pick the right federation choice.

Recap

You compared the federation standards.

  • SAML for enterprise IdPs, OIDC for workloads, web identity/Cognito for app users.
  • All exchange a verified external assertion via STS for temporary role credentials.
  • Federation removes the need for embedded long-term keys.

Frequently asked questions

Is the “SAML, OIDC, and Web Identity Federation” lesson free?

Yes — the full text of “SAML, OIDC, and Web Identity Federation” is free to read here on the web, and the AWS Security Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AWS Security Academy course, upgrade to CoddyKit PRO.

What will I learn in “SAML, OIDC, and Web Identity Federation”?

Connect external identity providers and app logins to AWS. You practise AWS Security Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start AWS Security Academy?

No prior experience is required. AWS Security Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “SAML, OIDC, and Web Identity Federation” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this AWS Security Academy lesson?

Yes. Every AWS Security Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Single Sign-On with IAM Identity Center
  2. SAML, OIDC, and Web Identity Federation
  3. Cross-Account Roles and Resource Policies
  4. Auditing Sharing with IAM Access Analyzer
← Back to AWS Security Academy