AWS Certified Developer – Associate (DVA-C02) — Question 383

A company is developing an application that will be accessed through the Amazon API Gateway REST API. Registered users should be the only ones who can access certain resources of this API. The token being used should expire automatically and needs to be refreshed periodically.

How can a developer meet these requirements?

Answer options

Correct answer: C

Explanation

Amazon Cognito user pools are designed for user directory management, authentication, and token handling (ID, access, and refresh tokens) which inherently support automatic expiration. By integrating a Cognito Authorizer with Amazon API Gateway, the API can seamlessly validate these JSON Web Tokens (JWTs) without custom code. Using Cognito identity pools (Option A) or IAM users (Option D) is meant for AWS resource authorization rather than user-level API access control, while managing custom tokens in a database (Option B) introduces unnecessary operational overhead.