An enterprise desktop application receives a signed SAML assertion from the corporate identity provider that authorizes two IAM roles. The application has no AWS credentials and must obtain temporary credentials for one authorized role; what should it do?
Show the answer
Correct answerB. Call AssumeRoleWithSAML with the assertion, selected role ARN, and SAML provider ARN.
AWhy not this: AssumeRoleWithWebIdentity accepts web identity tokens, not SAML assertions.
BWhy this is right: AssumeRoleWithSAML accepts the assertion, role ARN, and SAML provider ARN without preexisting AWS credentials.
CWhy not this: GetSessionToken requires AWS credentials and does not exchange SAML assertions for role credentials.
DWhy not this: AssumeRole requires AWS credentials to authenticate the request; an external ID is not a federation token.
AssumeRoleWithSAML exchanges a valid SAML assertion for temporary credentials for a selected authorized role, using the IAM SAML provider ARN. AssumeRole requires AWS-authenticated requests; its external ID parameter does not accept a SAML assertion as authentication.