Skip to Content
Asterrr's Handbook
4 · Identity and access management

Federation with SAML, OIDC and IAM Identity Center

Pick between IAM Identity Center, IAM SAML and OIDC providers, custom brokers and Active Directory options, and trace each token flow.

Exam tasks: 4.1 (Skills 4.1.1 identity solutions and IdP integration with Identity Center and MFA, 4.1.3 troubleshooting Identity Center permission sets and Directory Service)

The decision: where do your employees' identities already live, and how do you turn them into short-lived access to many AWS accounts without creating IAM users?

Federation lets identities from outside IAM receive temporary role credentials without an IAM user. The exam asks which mechanism fits, and which API or trust element makes it work.

1
Identity source per organization in IAM Identity Center.
1–12 h
Permission set session duration range (default 1 hour).
8
MFA devices per IAM user or root user.
2-way
Trust needed for Identity Center to use users from an on-prem domain through AWS Managed Microsoft AD.

Which one to use

Start with the tree for the Identity Center setup. The table covers every other mechanism.

yes (the usual case)one account, or a legacyIdP-to-role setupOkta, Entra ID, Ping,GoogleActive Directoryyes, or need trusts,LDAP-aware appsno, keep it on premisesnowhere yetEmployees need AWS accessOrganization with severalaccounts?IAM IdentityCenterIAM SAML 2.0 orOIDC identityprovider + rolesWhere are users managed?External IdP SAML 2.0 +SCIMRun the directory in AWS?AWS ManagedMicrosoft ADAD Connector(proxy toon-prem DCs)Identity Centerdirectory
Decision tree for picking the setup

Legacy: use IAM Identity Center instead

AWS Single Sign-On (AWS SSO) was renamed IAM Identity Center in 2022. The sso API prefixes and the "AWS access portal" remain. Treat any mention of "AWS SSO" as Identity Center.

NeedUseMechanism
Workforce sign-in to many accounts and apps, central permissionsIAM Identity CenterPermission sets become IAM roles in each account
One account, an existing SAML 2.0 IdP, no Identity CenterIAM SAML providerAssumeRoleWithSAML
CI/CD or service with a JWT (GitHub Actions)IAM OIDC providerAssumeRoleWithWebIdentity
Customers of a mobile or web appAmazon CognitoUser pools authenticate, identity pools issue AWS credentials
Your own identity store and portal codeCustom identity brokerAssumeRole or GetFederationToken, then the federation endpoint for console URLs
Windows users with on-premises ADIdentity Center with AD, or AD FS with SAMLSee below
Servers outside AWS with certificatesIAM Roles AnywhereX.509 certificate exchange

Exam signal

"Single sign-on to multiple accounts with job-function permissions" is IAM Identity Center. "Mobile app users, no embedded keys" is Cognito. "Pipeline outside AWS, no stored keys" is an OIDC provider with a trust condition on sub and aud.

SAML 2.0 flow

Corporate networkAWS accountsign inassertiontrust checkEmployeeSAML IdPSTSRole
The IdP authenticates and signs the assertion. STS validates it against the IAM SAML provider and returns role credentials.
  • Create the IAM SAML provider from the IdP metadata document. The role trust policy has Principal: Federated set to the provider ARN, action sts:AssumeRoleWithSAML, and conditions such as saml:aud. The SAML provider must live in the same account as the role.
  • The assertion maps users to roles. Optional attributes carry PrincipalTag: session tags, TransitiveTagKeys and SourceIdentity.
  • Console SSO posts the assertion to the Regional sign-in endpoint https://<region>.signin.aws.amazon.com/saml. Configure more than one endpoint for resilience.
  • IAM SAML providers accept encrypted assertions. IAM Identity Center and Cognito identity pools do not.
  • Use saml:sub with saml:namequalifier to build per-user S3 prefixes. Require saml:sub_type of persistent when the ID must stay stable.
  • IAM does not act on expiry of the X.509 certificate in SAML metadata. Monitor and rotate it.
  • The assertion's Role attribute lists the role and provider ARNs the user may assume. RoleSessionName and SessionDuration attributes set the session name and length.
  • Direct SAML federation works per account, so each account needs its own provider and roles. That's why Identity Center is the default answer for organizations.

OIDC and web identity flow

issues JWTJWTtrust checkOIDC providerApp or pipelineSTSRole
The app gets a JWT from the OIDC provider and exchanges it at STS. The call is unsigned, so no AWS key is needed.
  • STS verifies the JWT signature through the IdP JSON web key set, then evaluates the role trust policy. Scope the trust condition with aud and sub claims so only one repository or app can assume the role.
  • AWS accepts a JWT up to five minutes after its exp claim to allow for clock skew.
  • Session tags go in the token under the https://aws.amazon.com/tags claim, nested or flattened. Source identity uses https://aws.amazon.com/source_identity.
  • An account holds 100 OIDC providers by default (up to 700).
  • For human sign-up and sign-in, use Amazon Cognito as the broker instead of calling STS yourself.

IAM Identity Center

Management accountMember accountsusers, groupsassignedprovisionsIAM IdentityCenterPermission setProvisioned roleAD or externalIdP
Identity Center takes users from its own directory, Active Directory or an external IdP and turns permission set assignments into roles in each account.
TopicFact
Instance typesOrganization instance (best practice, deployed in the management account, only one that manages account access). Account instance bound to one account, for isolated AWS managed apps.
Identity sourcesIdentity Center directory, Active Directory, or external IdP over SAML 2.0 with SCIM. One source at a time.
Permission setTemplate of AWS managed, customer managed and inline policies, plus an optional permissions boundary. Assigning it creates and updates an IAM role in each target account.
Session durationPermission set sessions default to 1 hour, max 12 hours. Access portal session default 8 hours, max 90 days.
Changing sourceMoving to Active Directory deletes users, groups, memberships and assignments. Moving away from AD keeps them. The access portal URL changes.
Multi-RegionReplicating to other Regions is not available with AD as the source.
Account access managerIAM feature that assigns existing IAM roles to Identity Center users and groups when permission sets lack trust policy or path control.
ABACPass user attributes into sessions as principal tags and use aws:PrincipalTag in policies.
Trusted identity propagationLets AWS managed apps pass the user identity downstream, so CloudTrail shows the user.
Former nameAWS Single Sign-On

Permission sets in practice

  • Assigning a permission set to a user or group for an account creates a role named AWSReservedSSO_<set>_<id> in that account.
  • Customer managed policies referenced by a permission set must exist by name in every target account, or the provisioning fails.
  • Delegate administration to a member account so daily work doesn't happen in the management account.
  • The same sign-in also covers the CLI (aws configure sso) and applications through trusted identity propagation, which carries the user's identity to services such as Redshift or S3 Access Grants.

Editing the AWSReservedSSO role

Changes made directly to the AWSReservedSSO_... role in an account are overwritten or break the permission set. Edit the permission set and reprovision. If a permission set change doesn't show up, check provisioning status for that account.

External IdP: SAML plus SCIM

  • SAML 2.0 handles sign-in: the IdP authenticates the user and sends an assertion to Identity Center.
  • SCIM handles provisioning: users and groups are created and removed in Identity Center automatically. Without SCIM, you create users by hand, and SAML sign-in fails for any user who doesn't exist in Identity Center.
  • MFA is enforced by the external IdP. Identity Center's own MFA settings don't apply to external IdP users.

Active Directory options

AD ConnectorAWS Managed Microsoft AD
What it isA proxy that forwards to your on-prem domain controllersReal domain controllers run by AWS in two AZs
Stores identitiesNo, on premises onlyYes
Trusts with on-prem ADNoYes, one-way or two-way forest or external trusts
Depends on the on-prem linkEvery sign-inOnly for users from the trusted domain
Use with Identity CenterYesYes. Users in a trusted on-prem domain need a two-way trust
Also gives youSeamless domain join, WorkSpacesDomain join for EC2 and RDS SQL Server, LDAP apps, group policy
  • Simple AD isn't supported as an Identity Center source.
  • Troubleshooting a failed AD sign-in: check VPN or Direct Connect reachability to the DCs, security groups for DNS, Kerberos and LDAP ports, the AD Connector service account's permissions, and the trust direction.
  • AD Connector caches nothing. One connector per domain, no transitive trusts, not shareable across accounts and not multi-VPC. Small or large size. MFA through RADIUS. Console access comes from mapping AD users and groups to IAM roles.
  • AWS Managed Microsoft AD can be shared with other accounts, unlike AD Connector.
  • AD FS with SAML: AD authenticates and AD FS issues the SAML assertion for AssumeRoleWithSAML.

Exam signal

"Users must keep signing in with their existing on-premises AD credentials and no directory data may be stored in AWS" means AD Connector. "Run AD-aware workloads in AWS and let on-prem users access them" means AWS Managed Microsoft AD with a trust.

Exam trap

AssumeRoleWithSAML and AssumeRoleWithWebIdentity do not take MFA parameters. Enforce MFA at the IdP. Also, a custom broker that calls GetFederationToken needs an IAM user's long-term keys, and the resulting credentials cannot call IAM or most STS operations.

MFA for people is covered in Credentials, MFA and root access. ABAC from IdP attributes is in RBAC versus ABAC.

Scenarios

Scenario
A retailer uses Microsoft Entra ID for 4,000 employees and has 60 AWS accounts. Engineers must sign in with their Entra ID credentials and MFA, and access must be removed within minutes when someone leaves. What should the security team configure?
Scenario
After an administrator updated a permission set to add a customer managed policy named analytics-read, assignments to three accounts show a provisioning failure. The other accounts work. What is the most likely cause?

Further reading

On this page