Enabling an MFA device recorded state and changed nothing.
aws:MultiFactorAuthPresent and aws:MultiFactorAuthAge reached no request, so a
policy conditioned on either could not behave as it does on AWS, and
GetSessionToken and AssumeRole accepted SerialNumber and TokenCode and ignored
both, so no session could satisfy such a condition in the first place.
Both keys are published now from the credentials a request was signed with,
which is where the guide puts their availability: a long-term key carries
neither, and a session carries the first one, true only where a device was
used. A federated-user session carries neither, the guide putting federated
identities with the long-term keys. They are written by the one writer that
already says who is calling, so the enforcement filter, the per-resource and
per-item contexts, trust policies and the paths that evaluate a policy
themselves all see them at once.
The two STS operations hold a presented code to the seed of the device its
serial names, require that device to be enabled for the signing identity, and
spend the step it matched, since RFC 6238 has a verifier refuse the second
attempt of a code for the same time step. A key IAM holds nowhere has its claim
taken as made: there is no identity behind it whose devices could be checked,
and this emulator already reads such a key as acting for itself. A claim that
fails is refused with AccessDenied, the outcome AWS documents.
How far the authentication reaches is AWS's own line. GetSessionToken
credentials "include MFA information", so that session is MFA-authenticated on
its own requests. AssumeRole credentials "do not include MFA information in the
context", and "once the user has assumed the role, no further MFA checks are
made", so the device decides the assume and stops there. The device a call
presents belongs to that request, so both the trust policy and the caller's own
permission to make the call see it; the claim is read once per request and held
on it, a code being spendable only once.