CLOUD-DEPLOYMENT-AND-OPERATIONS practice question 8 of 15

(A company has implemented multifactor authentication (MFA) for access to its AWS tenant. Which API call is needed to perform MFA before accessing a resource?)

Full set: 67 questions
Answer options
A: GetCallerIdentity
B: GetSessionToken Correct answer
C: GetFederationToken
D: DecodeAuthorizationMessage
Correct Answer:
B. GetSessionToken
Explanation

The GetSessionToken API call is used by an AWS Identity and Access Management (IAM) user to obtain temporary security credentials. When an IAM policy requires multifactor authentication (MFA) for an action, the user must first call GetSessionToken, providing their access keys, the serial number of their MFA device, and the one-time password (OTP) generated by the device. If the credentials and MFA code are valid, the AWS Security Token Service (STS) returns a set of temporary credentials (access key ID, secret access key, and session token) that can then be used to make subsequent API calls to access the protected resources.

Why Incorrect

A. GetCallerIdentity is used to return details about the IAM identity (user, role) making the request; it does not perform MFA authentication.
C. GetFederationToken is used to obtain temporary credentials for a federated user authenticated by a custom identity broker, not for a standard IAM user MFA process.
D. DecodeAuthorizationMessage is a troubleshooting tool used to decode an encoded authorization failure message, providing details on why a request was denied.

References

1. AWS Security Token Service API Reference. The official documentation for the GetSessionToken action explicitly lists the SerialNumber and TokenCode parameters required for MFA. It states, "The identification number of the MFA device that is associated with the IAM user... The value provided by the MFA device."

Source: AWS Documentation, STS API Reference, "GetSessionToken - Request Parameters".

2. AWS Identity and Access Management User Guide. This guide details the process for configuring and using MFA-protected API access. It specifies that users must obtain temporary credentials using the GetSessionToken API call before they can access protected resources.

Source: AWS Documentation, IAM User Guide, Section: "Configuring MFA-protected API access".

3. Cloud Computing: Concepts, Technology & Architecture. In discussions of identity and access management in cloud environments, the mechanism for obtaining temporary, time-limited credentials after a primary and secondary factor authentication is a core concept. The GetSessionToken call is the AWS implementation of this principle for IAM users.

Source: Erl, T., Mahmood, Z., & Puttini, R. (2013). Cloud Computing: Concepts, Technology & Architecture. Prentice Hall. Chapter 7: Fundamental Cloud Security. (Note: This reference provides conceptual backing for the security pattern, which GetSessionToken implements).

Scroll to Top