Preporato

SAA-C03 Study Guide

Design Secure ArchitecturesSecure Access to AWS ResourcesDirectory Services & Federation (SAML, OIDC)

Key Concepts

  • AWS Directory Service options

  • AD Connector vs Managed AD

  • SAML 2.0 federation

  • OIDC federation

  • Cognito for web/mobile apps

Directory Services & Federation (SAML, OIDC)

Overview

AWS provides multiple ways to integrate identity management into your cloud architecture. AWS Directory Service allows you to run Microsoft Active Directory (AD) in the cloud or connect to your on-premises directory. Federation enables users to access AWS resources using credentials from external identity providers via SAML 2.0 or OpenID Connect (OIDC).

Understanding when to use each directory type and federation method is critical for the SAA-C03 exam. Questions often present scenarios where you must choose between AWS Managed Microsoft AD, AD Connector, Simple AD, or federation services like Cognito and IAM Identity Center.

Key Decision Points

Need AD features in AWS? → AWS Managed Microsoft AD Need to connect to on-premises AD? → AD Connector Need basic AD on a budget? → Simple AD Need mobile/web app authentication? → Amazon Cognito Need workforce SSO? → IAM Identity Center

Exam Tip

Know the limitations of each directory type. Simple AD doesn't support trust relationships or MFA. AD Connector doesn't cache credentials - it's just a proxy. AWS Managed Microsoft AD is the only one that supports trust relationships with on-premises AD.


Architecture Diagram

Directory Services Options
Figure 1: AWS Directory Service options and their use cases

Key Concepts

AWS Directory Service Options

AWS Managed Microsoft AD

AWS Managed Microsoft AD is a fully managed Microsoft Active Directory running on Windows Server.

Key Features:

  • Full Windows Server AD (not emulated)
  • Trust relationships with on-premises AD
  • Multi-AZ deployment for high availability
  • Automated backups and patching
  • Supports MFA (RADIUS integration)
  • Schema extensions supported

Best For:

  • Windows workloads needing full AD
  • Trust relationships with on-premises
  • Applications requiring LDAP
  • RDS for SQL Server authentication

AD Connector

AD Connector is a directory gateway that proxies requests to your on-premises Microsoft AD.

Key Features:

  • No data stored in AWS (proxy only)
  • Low latency to on-premises AD
  • Supports MFA via RADIUS
  • Works with WorkSpaces, WorkDocs, WorkMail

Limitations:

  • Requires VPN or Direct Connect to on-premises
  • Cannot be shared across AWS accounts
  • Not multi-VPC aware
  • No caching - dependent on connectivity

Best For:

  • Organizations with existing on-premises AD
  • When you don't want to replicate AD to cloud

Simple AD

Simple AD is a Samba 4-based directory compatible with Microsoft AD.

Key Features:

  • Lower cost than Managed Microsoft AD
  • Basic AD features (users, groups, policies)
  • Kerberos-based SSO
  • Two sizes: Small (500 users) or Large (5,000 users)

Limitations:

  • No trust relationships
  • No MFA support
  • No schema extensions
  • No PowerShell AD cmdlets
  • No DNS dynamic updates
  • Not compatible with RDS SQL Server

Best For:

  • Small organizations with basic AD needs
  • Linux workloads needing LDAP
  • Cost-sensitive environments

Directory Service Comparison

FeatureManaged Microsoft ADAD ConnectorSimple AD
TypeFull Windows ADProxy to on-premSamba-based AD
Trust RelationshipsYesVia on-prem ADNo
MFA SupportYes (RADIUS)Yes (RADIUS)No
Schema ExtensionsYesVia on-prem ADNo
Users SupportedUnlimitedDepends on on-prem500 or 5,000
Multi-AZYesYesYes
Share Across AccountsYesNoNo
RDS SQL ServerYesYesNo
PricingHighestMediumLowest

Federation Protocols

SAML 2.0 Federation

Security Assertion Markup Language (SAML) is an XML-based standard for exchanging authentication data.

How It Works:

  1. User authenticates with Identity Provider (IdP)
  2. IdP generates SAML assertion (signed XML)
  3. User presents assertion to AWS
  4. AWS validates assertion and provides access

AWS Services Supporting SAML:

  • IAM (direct federation)
  • IAM Identity Center
  • Amazon Cognito (Identity Pools)

Common SAML IdPs:

  • Okta, Azure AD, Ping Identity
  • ADFS (Active Directory Federation Services)
  • Google Workspace

OpenID Connect (OIDC) Federation

OpenID Connect is a modern authentication protocol built on OAuth 2.0.

How It Works:

  1. User authenticates with OIDC provider
  2. Provider issues ID token (JWT format)
  3. Application exchanges token for AWS credentials
  4. AWS STS validates and issues temporary credentials

AWS Services Supporting OIDC:

  • IAM (web identity federation)
  • Amazon Cognito (User Pools & Identity Pools)
  • EKS (for pod IAM roles)

Common OIDC Providers:

  • Google, Facebook, Amazon (social)
  • Okta, Auth0, Azure AD
  • GitHub (for EKS IRSA)

Amazon Cognito

Amazon Cognito

Amazon Cognito provides authentication for web and mobile applications.

Two Components:

User Pools:

  • User directory for app authentication
  • Sign-up and sign-in functionality
  • Social and SAML/OIDC federation
  • MFA support
  • JWT token generation

Identity Pools (Federated Identities):

  • Exchange tokens for AWS credentials
  • Supports authenticated and guest access
  • Maps users to IAM roles
  • Fine-grained access control

Use Together: User Pool authenticates → Identity Pool provides AWS credentials

Cognito User Pools vs Identity Pools

AspectUser PoolsIdentity Pools
PurposeAuthentication (who are you)Authorization (what can you access)
OutputJWT tokensAWS credentials
FederationSAML, OIDC, socialUser pool tokens, SAML, social
User StorageYes (directory)No (maps identities)
MFAYesVia User Pool
Best ForApp sign-inAWS resource access

How It Works

Federation Architecture

Federation Flow
Figure 2: SAML and OIDC federation flow for AWS access

SAML Federation with IAM

Step 1: Configure SAML Identity Provider in IAM

SHCreate SAML Identity Provider (CLI)
# Create SAML provider with metadata from your IdP
aws iam create-saml-provider \
  --name ExampleOktaProvider \
  --saml-metadata-document file://metadata.xml

Step 2: Create IAM Role for Federated Users

JSONSAML Federation Trust Policy
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "arn:aws:iam::123456789012:saml-provider/ExampleOktaProvider"
      },
      "Action": "sts:AssumeRoleWithSAML",
      "Condition": {
        "StringEquals": {
          "SAML:aud": "https://signin.aws.amazon.com/saml"
        }
      }
    }
  ]
}

Step 3: Map IdP Groups to IAM Roles

Configure your IdP to include role ARN in SAML assertions:

  • Attribute: https://aws.amazon.com/SAML/Attributes/Role
  • Value: arn:aws:iam::123456789012:role/FederatedRole,arn:aws:iam::123456789012:saml-provider/ExampleOktaProvider

OIDC Federation with Cognito

Step 1: Create Cognito User Pool

SHCreate User Pool (CLI)
aws cognito-idp create-user-pool \
  --pool-name MyAppUserPool \
  --policies "PasswordPolicy={MinimumLength=8,RequireUppercase=true,RequireLowercase=true,RequireNumbers=true}" \
  --auto-verified-attributes email \
  --mfa-configuration OPTIONAL

Step 2: Create Identity Pool

SHCreate Identity Pool (CLI)
aws cognito-identity create-identity-pool \
  --identity-pool-name MyAppIdentityPool \
  --allow-unauthenticated-identities \
  --cognito-identity-providers \
    ProviderName=cognito-idp.us-east-1.amazonaws.com/us-east-1_abc123,ClientId=1234567890abcdef

Step 3: Configure IAM Roles for Identity Pool

JSONIdentity Pool Trust Policy
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Federated": "cognito-identity.amazonaws.com"
      },
      "Action": "sts:AssumeRoleWithWebIdentity",
      "Condition": {
        "StringEquals": {
          "cognito-identity.amazonaws.com:aud": "us-east-1:12345678-1234-1234-1234-123456789012"
        },
        "ForAnyValue:StringLike": {
          "cognito-identity.amazonaws.com:amr": "authenticated"
        }
      }
    }
  ]
}

Directory Service Setup

AWS Managed Microsoft AD

SHCreate Managed Microsoft AD (CLI)
aws ds create-microsoft-ad \
  --name corp.example.com \
  --short-name CORP \
  --password 'ComplexPassword123!' \
  --edition Standard \
  --vpc-settings VpcId=vpc-12345678,SubnetIds=subnet-11111111,subnet-22222222

AD Connector

SHCreate AD Connector (CLI)
aws ds connect-directory \
  --name corp.example.com \
  --short-name CORP \
  --password 'ServiceAccountPassword!' \
  --size Small \
  --connect-settings VpcId=vpc-12345678,SubnetIds=subnet-11111111,subnet-22222222,CustomerDnsIps=10.0.0.10,10.0.0.11,CustomerUserName=svc_adconnector

Use Cases

Use Case 1: Enterprise Windows Workloads

Scenario: Company migrating Windows servers to AWS needs AD integration for authentication.

Solution:

  1. Deploy AWS Managed Microsoft AD
  2. Establish trust with on-premises AD
  3. Join EC2 instances to domain
  4. Use existing AD credentials

Use Case 2: Hybrid Identity with Existing AD

Scenario: Company wants to use existing on-premises AD for AWS services without replicating data.

Solution:

  1. Deploy AD Connector
  2. Configure VPN or Direct Connect
  3. Configure WorkSpaces/WorkMail to use AD Connector
  4. Users authenticate with on-premises credentials

Use Case 3: Mobile App with Social Login

Scenario: Mobile app needs Google/Facebook login with access to S3 for user data.

Solution:

  1. Create Cognito User Pool with social IdP federation
  2. Create Identity Pool linked to User Pool
  3. Configure IAM role with S3 access (scoped to user ID)
  4. App uses Cognito SDK for authentication

Use Case 4: Workforce SSO to AWS Console

Scenario: 500 employees need console access using corporate Okta credentials.

Solution:

  1. Configure IAM Identity Center
  2. Set up Okta as external SAML IdP
  3. Create permission sets for different roles
  4. Assign users/groups to accounts

Use Case 5: B2B Partner Access

Scenario: External partners need temporary access to specific AWS resources.

Solution:

  1. Create SAML federation with partner's IdP
  2. Create IAM role with limited permissions
  3. Partner users authenticate via their IdP
  4. Receive temporary AWS credentials

Best Practices

Directory Service Best Practices
  1. Choose Based on Requirements - Don't over-provision; Simple AD may be enough
  2. Deploy Multi-AZ - All directory types support Multi-AZ for resilience
  3. Use Separate Subnets - Deploy directory in dedicated subnets
  4. Monitor with CloudWatch - Track directory health and performance
  5. Regular Snapshots - Enable automated backups for recovery
  6. Secure Service Accounts - Use strong passwords, rotate regularly
Federation Best Practices
  1. Use IAM Identity Center for Workforce - Preferred over direct IAM SAML
  2. Use Cognito for Customer Identity - Purpose-built for app authentication
  3. Implement MFA - Require MFA at IdP level
  4. Short Session Durations - Minimize credential lifetime
  5. Audit Federation Events - Monitor with CloudTrail
  6. Map Groups to Roles - Don't create individual role assignments

Common Exam Scenarios

Exam Scenarios

ScenarioSolutionWhy
Windows EC2 instances need domain joinAWS Managed Microsoft ADFull AD features for Windows workloads
Use existing on-premises AD without syncAD ConnectorProxy to on-prem, no data in cloud
Small team needs basic user directorySimple ADCost-effective for basic needs
Mobile app needs Facebook/Google loginCognito User Pool with social IdPBuilt-in social federation
App users need S3 access based on identityCognito Identity PoolExchange tokens for AWS credentials
Enterprise employees need AWS Console SSOIAM Identity Center with SAMLWorkforce SSO solution
Trust relationship between cloud and on-prem ADAWS Managed Microsoft ADOnly option supporting AD trusts
Third-party SaaS needs temporary AWS accessIAM SAML federationCross-organization federation

Common Pitfalls

Pitfall 1: Choosing Simple AD When You Need Trusts

Mistake: Selecting Simple AD when trust relationships are required.

Why it fails:

  • Simple AD does not support trust relationships
  • Cannot connect to on-premises AD forest
  • Limited to standalone directory

Correct Approach:

  • Use AWS Managed Microsoft AD for trust relationships
  • Or use AD Connector to proxy to on-premises AD
Pitfall 2: AD Connector Without Redundant Connectivity

Mistake: Using AD Connector with single VPN connection.

Why it's risky:

  • AD Connector is a proxy - no caching
  • If connectivity fails, authentication fails
  • Single point of failure

Correct Approach:

  • Deploy redundant VPN or Direct Connect
  • Consider AWS Managed Microsoft AD with trust for resilience
  • Monitor connectivity health
Pitfall 3: Confusing Cognito User Pools and Identity Pools

Mistake: Using Identity Pool for authentication or User Pool for AWS credentials.

Why it causes issues:

  • User Pools = authentication (JWT tokens)
  • Identity Pools = authorization (AWS credentials)
  • Using wrong one won't achieve goal

Correct Approach:

  • Use User Pool for sign-in/sign-up
  • Use Identity Pool to exchange tokens for AWS credentials
  • Often used together in sequence
Pitfall 4: Embedding Federation Credentials in Apps

Mistake: Hardcoding IdP metadata or secrets in application code.

Why it's dangerous:

  • Credentials can be exposed
  • Difficult to rotate
  • Violates security best practices

Correct Approach:

  • Use AWS Secrets Manager for sensitive data
  • Use Cognito SDK which handles token management
  • Store IdP configuration in environment variables

Test Your Knowledge

Q

Which AWS Directory Service option supports trust relationships with on-premises Active Directory?

ASimple AD
BAD Connector
CAWS Managed Microsoft AD
DAmazon Cognito
Q

A mobile application needs to allow users to sign in with their Facebook accounts and then access user-specific data in S3. What AWS services should be used?

AIAM Identity Center with SAML
BCognito User Pool + Identity Pool
CDirect IAM SAML federation
DSimple AD with RADIUS
Q

What is the key difference between AD Connector and AWS Managed Microsoft AD?

AAD Connector supports MFA, Managed AD does not
BAD Connector stores user data in AWS, Managed AD does not
CAD Connector is a proxy to on-premises AD, Managed AD runs AD in AWS
DAD Connector is cheaper for large organizations
Q

Which federation protocol uses XML-based assertions for authentication?

AOAuth 2.0
BOpenID Connect
CSAML 2.0
DKerberos


Quick Reference

Directory Service Sizing

Directory Service Sizing

ServiceSizeUsersUse Case
Simple ADSmallUp to 500Small teams, testing
Simple ADLargeUp to 5,000Medium organizations
AD ConnectorSmallUp to 500Small hybrid deployments
AD ConnectorLargeUp to 5,000Large hybrid deployments
Managed ADStandardUp to 5,000Most production workloads
Managed ADEnterpriseUp to 100,000+Large enterprises

Federation Method Selection

When to Use Each Federation Method

ScenarioRecommended ServiceProtocol
Workforce SSO to AWS ConsoleIAM Identity CenterSAML 2.0
Mobile app with social loginCognito User PoolOIDC
App users need AWS credentialsCognito Identity PoolOIDC/SAML
Third-party vendor AWS accessIAM SAML ProviderSAML 2.0
Kubernetes pod IAM roles (EKS)IAM OIDC ProviderOIDC
Enterprise SSO to AWS ConsoleIAM Identity CenterSAML 2.0

CLI Commands Reference

SHDirectory Service CLI Commands
# List directories
aws ds describe-directories

# Create Microsoft AD
aws ds create-microsoft-ad --name corp.example.com --password 'Password' --edition Standard --vpc-settings VpcId=vpc-xxx,SubnetIds=subnet-xxx

# Create trust relationship
aws ds create-trust --directory-id d-xxx --remote-domain-name onprem.example.com --trust-password 'TrustPassword' --trust-direction Two-Way

# Create AD Connector
aws ds connect-directory --name corp.example.com --password 'Password' --size Small --connect-settings VpcId=vpc-xxx,SubnetIds=subnet-xxx,CustomerDnsIps=10.0.0.10

# Delete directory
aws ds delete-directory --directory-id d-xxx
SHCognito CLI Commands
# Create User Pool
aws cognito-idp create-user-pool --pool-name MyPool

# Create User Pool Client
aws cognito-idp create-user-pool-client --user-pool-id us-east-1_xxx --client-name MyAppClient

# Create Identity Pool
aws cognito-identity create-identity-pool --identity-pool-name MyIdentityPool --allow-unauthenticated-identities

# List User Pools
aws cognito-idp list-user-pools --max-results 10

# Get Identity Pool roles
aws cognito-identity get-identity-pool-roles --identity-pool-id us-east-1:xxx

SAML Attributes for AWS

TEXTRequired SAML Attributes
# Role attribute (required)
Name: https://aws.amazon.com/SAML/Attributes/Role
Value: arn:aws:iam::ACCOUNT:role/ROLE,arn:aws:iam::ACCOUNT:saml-provider/PROVIDER

# Session duration (optional)
Name: https://aws.amazon.com/SAML/Attributes/SessionDuration
Value: 3600 (seconds, max 43200)

# Role session name (optional but recommended)
Name: https://aws.amazon.com/SAML/Attributes/RoleSessionName
Value: user@example.com

Further Reading

Related AWS Services

Directory ServiceCognitoIAM