Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profile X requires multi-factor authentication, but no MFA code callback was provided #1769

Open
TasneemZh opened this issue Mar 12, 2024 · 0 comments

Comments

@TasneemZh
Copy link

TasneemZh commented Mar 12, 2024

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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant