Skip to main content

DVA-C02 practice question · Security

A mobile application authenticates users via a third-party OpenID Connect provider directly (not through Cognito user…

A mobile application authenticates users via a third-party OpenID Connect provider directly (not through Cognito user pools) and needs to exchange that provider's token for temporary AWS credentials scoped to that user. Which STS API supports this pattern?

  • AAssumeRoleWithWebIdentity
  • BAssumeRole, using long-term IAM user access keys embedded in the mobile app
  • CGetSessionToken, which is designed for federating an external identity provider's token
  • DSTS has no capability to work with external identity providers
Show the answer and explanation

Correct answer: A) AssumeRoleWithWebIdentity

Why each option is right or wrong

  • A) Correct. AssumeRoleWithWebIdentity lets an application exchange a token from a supported web identity provider (like an OIDC provider) directly for temporary AWS credentials tied to an IAM role, without needing long-term AWS credentials embedded in the mobile app.
  • B) Incorrect. Embedding long-term IAM user credentials in a mobile app to then call AssumeRole is a security anti-pattern and isn't the federated-identity flow this scenario calls for; AssumeRoleWithWebIdentity is the purpose-built API for exchanging an external identity token directly.
  • C) Incorrect. GetSessionToken is used to get temporary credentials for an already-existing IAM user (e.g., to enable MFA-protected API access), not for federating an external OIDC token — AssumeRoleWithWebIdentity is the one built for that.
  • D) Incorrect. STS explicitly supports federating external web identity tokens via AssumeRoleWithWebIdentity — this option is factually incorrect.
Exam domain
Security · 26% of DVA-C02
Question type
Multiple choice (one answer)

Practise the full DVA-C02 exam

This question is one of a small free sample from the CertRidge DVA-C02 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.

Original question written from the official exam guide. Not affiliated with AWS; never copied from the real exam.

Worth reading: DVA-C02 cheat sheet, Lambda, DynamoDB, API Gateway, IAM and Cognito, messaging, CI/CD and X-Ray in tables, plus what DVA-C03 changes.