Security Engineering

A public mobile app has no secure place to store a client secret. It must call a partner API on a user's behalf with scoped, delegated access, and a malicious app on the device must not be able to redeem an intercepted authorization code. Which OAuth 2.0 flow fits?

Show the answer

Correct answerD. Authorization code grant with PKCE

AWhy not this: The password grant makes the app handle the user's credentials, which defeats delegated access without sharing passwords.

BWhy not this: The implicit grant exposes the access token in the redirect and does not protect against interception on the device.

CWhy not this: Client credentials authenticates the app itself with a secret, which gives no delegated user access and a public app cannot keep a secret.

DWhy this is right: PKCE binds the authorization code to the requesting app through a code verifier, so no client secret is needed and stolen codes cannot be redeemed.

The authorization code grant with PKCE gives a public client delegated user access. A one-time code verifier ties the code to the app that requested it, so an intercepted code is useless. Client credentials has no user context and needs a secret.