Code Monkey home page Code Monkey logo

Comments (3)

Jordan-Nelson avatar Jordan-Nelson commented on August 30, 2024 1

@sisygoboom Thank you. It looks like the issue is that the oAuth info isn't added to your config. We have an issue open for this already: aws-amplify/amplify-backend#1551

I am going to keep this issue open because Amplify Flutter should throw a better error message in this scenario.

from amplify-flutter.

Jordan-Nelson avatar Jordan-Nelson commented on August 30, 2024

Hello @sisygoboom. Can you share your Amplify Configuration? You can remove any sensitive or app specific information.

from amplify-flutter.

sisygoboom avatar sisygoboom commented on August 30, 2024

Auth construct:

import { defineAuth, secret } from '@aws-amplify/backend';

/**
 * Define and configure your auth resource
 * @see https://docs.amplify.aws/gen2/build-a-backend/auth
 */
export const auth = defineAuth({
  loginWith: {
    phone: true,
    externalProviders: {
      facebook: {
        clientId: secret('FACEBOOK_APP_ID'),
        clientSecret: secret('FACEBOOK_APP_SECRET'),
        scopes: ['email', 'public_profile'],
      },
      google: {
        clientId: secret('GOOGLE_CLIENT_ID'),
        clientSecret: secret('GOOGLE_CLIENT_SECRET'),
        scopes: ['email', 'profile'],
      },
      callbackUrls: ['paritae://callback'], // Ensure these match your actual callback URLs
      logoutUrls: ['paritae://logout'], // Ensure these match your actual logout URLs
    },    
  },
  userAttributes: {
    email: {
      required: true,
      mutable: true
    },
    phoneNumber: {
      required: false,
      mutable: true
    },
    profilePicture: {
      required: false,
      mutable: true,
    }
  }
});

amplify config:

const amplifyConfig = '''{
  "UserAgent": "@aws-amplify/client-config/1.0.2",
  "Version": "1.0",
  "auth": {
    "plugins": {
      "awsCognitoAuthPlugin": {
        "UserAgent": "@aws-amplify/client-config/1.0.2",
        "Version": "1.0",
        "CognitoUserPool": {
          "Default": {
            "PoolId": "REDACTED",
            "AppClientId": "REDACTED",
            "Region": "REDACTED"
          }
        },
        "CredentialsProvider": {
          "CognitoIdentity": {
            "Default": {
              "PoolId": "REDACTED",
              "Region": "REDACTED"
            }
          }
        },
        "Auth": {
          "Default": {
            "authenticationFlowType": "USER_SRP_AUTH",
            "passwordProtectionSettings": {
              "passwordPolicyMinLength": 8,
              "passwordPolicyCharacters": [
                "REQUIRES_NUMBERS",
                "REQUIRES_LOWERCASE",
                "REQUIRES_UPPERCASE",
                "REQUIRES_SYMBOLS"
              ]
            },
            "signupAttributes": [
              "EMAIL"
            ],
            "usernameAttributes": [
              "PHONE_NUMBER"
            ],
            "verificationMechanisms": [
              "PHONE_NUMBER"
            ]
          }
        },
        "AppSync": {
          "Default": {
            "ApiUrl": "REDACTED",
            "Region": "REDACTED",
            "AuthMode": "REDACTED",
            "ClientDatabasePrefix": "REDACTED"
          },
          "data_AMAZON_COGNITO_USER_POOLS": {
            "ApiUrl": "REDACTED",
            "Region": "REDACTED",
            "AuthMode": "REDACTED",
            "ClientDatabasePrefix": "REDACTED"
          }
        }
      }
    }
  },
  "api": {
    "plugins": {
      "awsAPIPlugin": {
        "data": {
          "endpointType": "GraphQL",
          "endpoint": "REDACTED",
          "region": "REDACTED",
          "authorizationType": "REDACTED"
        }
      }
    }
  }
}''';

Command used:

npx ampx sandbox --outputs-format dart --outputs-out-dir lib --outputs-version 0

from amplify-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.