DOP-C02 Security and Compliance Practice Question
A DevOps team is deploying a web application on EC2 instances behind an ALB. The application must authenticate users using an external identity provider (IdP) that supports SAML 2.0. Which solution provides the simplest integration with the ALB?
⚠ Common exam trap
The trap here is that candidates often overcomplicate the solution by assuming they need a separate identity service like Cognito or custom code, when the ALB itself can directly integrate with any SAML 2.0 IdP, making it the simplest and most AWS-native choice.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Configure the ALB to use an SAML identity provider for authentication
The Application Load Balancer (ALB) natively supports SAML 2.0 identity provider (IdP) authentication. This allows the ALB to offload user authentication at the edge, validating SAML assertions directly and forwarding authenticated requests to the target EC2 instances without any application-level changes. This is the simplest integration as it requires no additional infrastructure or code on the EC2 instances.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Amazon Cognito user pools with SAML federation and integrate with ALB
Why it's wrong here
Using Cognito user pools with SAML federation and integrating the ALB would create an unnecessary intermediary, because the ALB already has first-class support for external SAML IdPs. In this architecture you would configure the ALB to use Cognito's OIDC endpoint, then map Cognito's federation to the upstream SAML IdP, adding an extra hop, extra token transformation logic, and another failure domain. ALB can instead consume the SAML IdP directly at the listener, eliminating the need to manage Cognito's domain, app clients, and federation mappings for this use case.
- ✗
Use AWS CloudFront with Lambda@Edge to validate SAML tokens
Why it's wrong here
CloudFront with Lambda@Edge can inspect and validate SAML assertions at the edge, but it cannot natively integrate with the ALB’s authentication flow; the ALB requires a built-in SAML IdP configuration to offload token validation at the listener level, not a separate edge function. This option is tempting because Lambda@Edge is often used for custom authentication logic, such as validating JWTs or redirecting to an IdP for CloudFront distributions, and would be correct if the requirement were to authenticate users at the CDN layer rather than at the ALB.
- ✗
Install a SAML service provider library on each EC2 instance
Why it's wrong here
Installing an SAML service provider library on each EC2 instance means every instance must implement the SP side of the SAML protocol, including parsing assertions, validating signatures, and maintaining session state in application code. This forces application-level changes, complicates horizontal scaling because session state may not be shared across instances, and requires rotating certificates at the application layer. The ALB is designed to offload exactly this authentication burden, so pushing it back into the instances is an anti-pattern.
- ✓
Configure the ALB to use an SAML identity provider for authentication
Why this is correct
Configuring the ALB to use an SAML identity provider lets the load balancer act as the relying party, terminating the SAML exchange at the edge of the AWS network. When an unauthenticated user requests a protected target group, the ALB redirects to the IdP, validates the returned assertion, sets an encrypted session cookie, and forwards the authenticated session details to the backend as HTTP headers. This makes authentication transparent to the EC2 instances, so no code changes are required and security is centralized at one access point.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DOP-C02 question from scratch — 251 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.