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.
Which one to use
Start with the tree for the Identity Center setup. The table covers every other mechanism.
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.
| Need | Use | Mechanism |
|---|---|---|
| Workforce sign-in to many accounts and apps, central permissions | IAM Identity Center | Permission sets become IAM roles in each account |
| One account, an existing SAML 2.0 IdP, no Identity Center | IAM SAML provider | AssumeRoleWithSAML |
| CI/CD or service with a JWT (GitHub Actions) | IAM OIDC provider | AssumeRoleWithWebIdentity |
| Customers of a mobile or web app | Amazon Cognito | User pools authenticate, identity pools issue AWS credentials |
| Your own identity store and portal code | Custom identity broker | AssumeRole or GetFederationToken, then the federation endpoint for console URLs |
| Windows users with on-premises AD | Identity Center with AD, or AD FS with SAML | See below |
| Servers outside AWS with certificates | IAM Roles Anywhere | X.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
- Create the IAM SAML provider from the IdP metadata document. The role trust policy has
Principal: Federatedset to the provider ARN, actionsts:AssumeRoleWithSAML, and conditions such assaml: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,TransitiveTagKeysandSourceIdentity. - 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:subwithsaml:namequalifierto build per-user S3 prefixes. Requiresaml:sub_typeofpersistentwhen 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
Roleattribute lists the role and provider ARNs the user may assume.RoleSessionNameandSessionDurationattributes 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
- STS verifies the JWT signature through the IdP JSON web key set, then evaluates the role trust policy. Scope the trust condition with
audandsubclaims so only one repository or app can assume the role. - AWS accepts a JWT up to five minutes after its
expclaim to allow for clock skew. - Session tags go in the token under the
https://aws.amazon.com/tagsclaim, nested or flattened. Source identity useshttps://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
| Topic | Fact |
|---|---|
| Instance types | Organization 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 sources | Identity Center directory, Active Directory, or external IdP over SAML 2.0 with SCIM. One source at a time. |
| Permission set | Template 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 duration | Permission set sessions default to 1 hour, max 12 hours. Access portal session default 8 hours, max 90 days. |
| Changing source | Moving to Active Directory deletes users, groups, memberships and assignments. Moving away from AD keeps them. The access portal URL changes. |
| Multi-Region | Replicating to other Regions is not available with AD as the source. |
| Account access manager | IAM feature that assigns existing IAM roles to Identity Center users and groups when permission sets lack trust policy or path control. |
| ABAC | Pass user attributes into sessions as principal tags and use aws:PrincipalTag in policies. |
| Trusted identity propagation | Lets AWS managed apps pass the user identity downstream, so CloudTrail shows the user. |
| Former name | AWS 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 Connector | AWS Managed Microsoft AD | |
|---|---|---|
| What it is | A proxy that forwards to your on-prem domain controllers | Real domain controllers run by AWS in two AZs |
| Stores identities | No, on premises only | Yes |
| Trusts with on-prem AD | No | Yes, one-way or two-way forest or external trusts |
| Depends on the on-prem link | Every sign-in | Only for users from the trusted domain |
| Use with Identity Center | Yes | Yes. Users in a trusted on-prem domain need a two-way trust |
| Also gives you | Seamless domain join, WorkSpaces | Domain 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
Identity Center with SAML for sign-in and SCIM for provisioning gives one place to assign access across all accounts, and SCIM removes users when they're disabled in Entra ID. Per-account SAML works but multiplies the setup by 60 and has no provisioning. AD Connector needs an Active Directory domain, not Entra ID. IAM users are long-term credentials that the company would have to deprovision by hand.
A permission set references customer managed policies by name, so each target account must already contain a policy with that name and path. The session limit can't be set above 12 hours at all. Group membership affects who can use the assignment, not whether it provisions. Provisioning is done by Identity Center's service-linked roles, which SCPs don't restrict.
Related
- STS, roles and cross-account access
- Credentials, MFA and root access
- RBAC versus ABAC
- Cognito and API Gateway authorizers
- Active Directory trust and federation
- AWS Directory Service cheat sheet
Further reading
- SAML 2.0 federation
- OIDC federation
- Request temporary security credentials
- Pass session tags in AWS STS
- IAM and AWS STS quotas
- What is IAM Identity Center?
- Permission sets
- Identity source considerations
- AD Connector
- Attributes for access control in IAM Identity Center
- AWS Directory Service: which directory to choose
IAM identities and policy types
Users, groups, roles, the nine policy types, policy JSON elements, condition operators and keys, NotAction, and the IAM size limits the exam quotes.
STS, roles and cross-account access
Choosing the right STS API, cross-account role assumption, external ID, session tags, source identity, role chaining, IAM Roles Anywhere and revoking sessions.