/Identity Federation: SAML, OIDC, Cognito & IAM Identity Center
Concept Detail

Identity Federation: SAML, OIDC, Cognito & IAM Identity Center

Difficulty: hard

Overview


AWS supports multiple identity federation methods for enterprise and web/mobile use cases.

SAML 2.0 Federation (Enterprise):

  • AD/LDAP users authenticate to IdP (ADFS, Okta, Ping) → SAML assertion
  • SAML assertion sent to AWS STS AssumeRoleWithSAML → temporary credentials
  • Console SSO: SAML assertion → AWS sign-in endpoint → console redirect
  • Session duration: 1 hour default, up to 12 hours for SAML roles
  • Trust: IAM role trust policy must trust sts.amazonaws.com and the SAML provider

OIDC / Web Identity Federation:

  • Used for mobile/web apps with social providers (Google, Amazon, Facebook, Cognito)
  • App authenticates with IdP → receives ID/access token
  • Exchange token with STS AssumeRoleWithWebIdentity → AWS temporary credentials
  • Trust policy condition: accounts.google.com:aud (app client ID) + accounts.google.com:sub (user ID)

Amazon Cognito:

ComponentPurposeOutput
User PoolAuth directory: sign-up, sign-in, MFAJWTs (ID, Access, Refresh)
Identity PoolAWS credential vendingTemporary AWS credentials via STS

Combined flow:

  1. User authenticates with User Pool → receives JWT
  2. Exchange JWT with Identity Pool → STS AssumeRoleWithWebIdentity → AWS credentials
  3. App accesses AWS services directly (S3, DynamoDB) with temp credentials

AWS IAM Identity Center (formerly SSO):

  • Centralized SSO for AWS accounts (via Organizations) and business apps (Salesforce, Slack)
  • Connect to external IdP (Okta, Azure AD) via SAML 2.0
  • Permission Sets: define AWS permissions assigned to users/groups per account
  • Propagates via AWS Organizations — new accounts automatically get SSO configured
  • Replaces manual SAML federation per account

STS Key APIs:

APIUse Case
AssumeRoleCross-account/service role assumption
AssumeRoleWithSAMLEnterprise SAML federation
AssumeRoleWithWebIdentityOIDC/social provider federation
GetSessionTokenMFA-protected API access
GetFederationTokenLegacy; broker-based federation

Practice Linked Questions


medium

Q1. A company uses Microsoft Active Directory and wants AD users to access the AWS Management Console using Single Sign-On without creating IAM users in AWS. Which federation approach is MOST appropriate?


Select one answer before revealing.

easy

Q2. What does Amazon Cognito User Pool provide?


Select one answer before revealing.

medium

Q3. A company wants to provide SSO access for employees to 20+ AWS accounts and business applications (Salesforce, Slack, Jira) using their existing Okta identity provider. Which AWS service is MOST appropriate?


Select one answer before revealing.

hard

Q4. A mobile application allows users to log in with Google. After Google authentication, the app needs to access Amazon DynamoDB tables directly from the device. Which approach correctly enables this with temporary AWS credentials?


Select one answer before revealing.

hard

Q5. A developer calls sts:AssumeRoleWithWebIdentity to get AWS credentials using a Google ID token. Which condition in the IAM role's trust policy ensures ONLY legitimate users of YOUR specific Google application (not any Google user) can assume the role?


Select one answer before revealing.

hard

Q6. A company's SAML-federated developers assume an IAM role with an 8-hour session. A security incident requires immediately revoking ALL active sessions for this role. What is the CORRECT approach?


Select one answer before revealing.

medium

Q7. An API Gateway REST API uses a Cognito User Pool Authorizer. A mobile app user authenticates with Cognito, receives JWTs, and calls the API. What does API Gateway validate in this flow?


Select one answer before revealing.