dherault / dherault/serverless-offline
Profile X requires multi-factor authentication, but no MFA code callback was provided
- Dominant language
- JavaScript
- Stars
- 5.3k
- Forks
- 811
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 3
Description
I'm facing this error "**Profile X requires multi-factor authentication, but no MFA code callback was provided**" when trying to access AWS resources through AWS NodeJS SDK "@aws-sdk" by the session generated by the assumed role on my terminal:
`aws sts assume-role --role-arn [role-arn] --role-session-name [session-name] --serial-number [arn-of-root-account] --token-code [token-code]`
I can access the same AWS resources by "aws" CLI with no issues. However, running the "serverless offline" command, it requests an MFA code, I enter a valid one and the server starts running successfully locally but it returns the above error when I try accessing any AWS resource through AWS SDK.
- file: serverless.yml
```yaml
service: my-service
plugins:
- serverless-offline
frameworkVersion: '3'
provider:
runtime: nodejs20.x
plugins:
- serverless-offline
custom:
serverless-offline:
port: 4086
prefix: data-${self:service}
```
**Environment**
- `serverless` v3.38.0
- `serverless-offline` v13.3.3
- `node.js` v21.6.2
- `OS` Windows 11
Contributor guide
Assessment
This issue has not been assessed yet.