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

Incorrect default mfa_configuration value of OFF instead of NONE in latest amplify_outputs.json #1644

Closed
phantumcode opened this issue Jun 12, 2024 · 2 comments
Labels
amplify_outputs Issue related to generating amplify_outputs for deployed backends bug Something isn't working p2

Comments

@phantumcode
Copy link

phantumcode commented Jun 12, 2024

Environment information

System:
  OS: macOS 14.4.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 211.27 MB / 32.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 18.19.0 - /opt/homebrew/opt/node@18/bin/node
  Yarn: 1.22.19 - /opt/homebrew/bin/yarn
  npm: 10.2.3 - /opt/homebrew/opt/node@18/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/backend: 1.0.3
  @aws-amplify/backend-cli: 1.0.4
  aws-amplify: 6.3.6
  aws-cdk: 2.145.0
  aws-cdk-lib: 2.145.0
  typescript: 5.4.5
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description

The amplify_outputs.json value for auth configuration contains the following field/value"mfa_configuration": "OFF". This is causing Amplify configuration error on Android native applications due to a deserialization error for the incorrect/unsupported value. The expected value is NONE.

Auth backend definition:

export const auth = defineAuth({
  loginWith: {
    email: true,
  },
});

Here's the generated auth configuration in amplify_outputs.json:

  "auth": {
    "user_pool_id": "us-east-1xxxxxxx",
    "aws_region": "us-east-1",
    "user_pool_client_id": "xxxxxxxxx",
    "identity_pool_id": "us-east-1:xxxxxxxx",
    "mfa_methods": [],
    "standard_required_attributes": [
      "email"
    ],
    "username_attributes": [
      "email"
    ],
    "user_verification_types": [
      "email"
    ],
    "mfa_configuration": "OFF",
    "password_policy": {
      "min_length": 8,
      "require_numbers": true,
      "require_lowercase": true,
      "require_uppercase": true,
      "require_symbols": true
    },
    "unauthenticated_identities_enabled": true
  },
@phantumcode phantumcode added the pending-triage Incoming issues that need categorization label Jun 12, 2024
@ykethan
Copy link
Member

ykethan commented Jun 12, 2024

Noticed this in the amplify_outputs.json. Marking this as bug.

@ykethan ykethan added bug Something isn't working amplify_outputs Issue related to generating amplify_outputs for deployed backends and removed pending-triage Incoming issues that need categorization labels Jun 12, 2024
@josefaidt
Copy link
Contributor

note: this is missing from the parsing logic in aws-amplify https://github.com/aws-amplify/amplify-js/blob/de6b06db80b02687e597aceaa2c33f65171a6389/packages/core/src/parseAmplifyOutputs.ts#L328-L335. Despite the schema specifying NONE as a valid option in place of OFF, OFF is passed through from the CFN value to the generated outputs file, and the library is correctly parsing it as "OFF"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
amplify_outputs Issue related to generating amplify_outputs for deployed backends bug Something isn't working p2
Projects
None yet
Development

No branches or pull requests

3 participants