amplify-js: Federated Facebook login does not call Cognito Lambda triggers

Describe the bug When logging in with Facebook federated logins, Cognito Lambda triggers are not called depending on the state of the user.

To Reproduce Steps to reproduce the behavior:

I start with a fresh Cognito with no users. I have a Pre Sign-up trigger and a Post Authentication trigger. When using a custom auth flow, both of these triggers are called properly. However when using a federated login flow the triggers are not called as expected.

Start with empty cognito, no users Facebook federated login pre sign-up trigger is called post auth trigger is NOT called cognito user record has been created logout Facebook login again pre sign-up trigger is NOT called post auth trigger is called

Expected behavior Just as in a custom auth flow, both Pre and Post triggers should be called during a federated login.

Code Snippet

Auth.federatedSignIn({provider: 'Facebook'});

What is Configured? My backend is configured with Serverless, not Amplify CLI. This is my Amplify config:

Auth: {
        userPoolId: Config.COGNITO_USER_POOL_ID,
        region: Config.COGNITO_REGION,
        userPoolWebClientId: Config.COGNITO_USER_POOL_WEB_CLIENT_ID,
        identityPoolId: Config.COGNITO_IDENTITY_POOL_ID,
        authenticationFlowType: Config.COGNITO_AUTHENTICATION_FLOW_TYPE,
        oauth: {
          domain: Config.COGNITO_DOMAIN,
          scope: [
            'phone',
            'email',
            'profile',
            'openid',
            'aws.cognito.signin.user.admin',
          ],
          redirectSignIn: 'https://app.mydomain.com/signIn',
          redirectSignOut: 'https://app.mydomain.com/signOut',
          responseType: 'code',
        },
      },
Environment
System:
    OS: macOS 10.15.4
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 5.26 GB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.2.0 - ~/.nvm/versions/node/v14.2.0/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v14.2.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 81.0.4044.138
    Firefox: 76.0.1
    Safari: 13.1
  npmPackages:
    @aws-amplify/analytics: ^3.1.11 => 3.1.11 
    @aws-amplify/auth: ^3.2.8 => 3.2.8 
    @aws-amplify/cache: ^3.1.11 => 3.1.11 
    @aws-amplify/core: ^3.2.8 => 3.2.8 
    @aws-amplify/pushnotification: ^3.0.12 => 3.0.12 
    @aws-amplify/storage: ^3.2.1 => 3.2.1 
    @babel/core: ^7.6.2 => 7.9.0 
    @babel/runtime: ^7.6.2 => 7.9.2 
    @react-native-community/async-storage: ^1.10.1 => 1.10.1 
    @react-native-community/eslint-config: ^0.0.5 => 0.0.5 
    @react-native-community/masked-view: ^0.1.10 => 0.1.10 
    @react-native-community/netinfo: ^5.8.0 => 5.8.1 
    @react-native-community/picker: ^1.3.0 => 1.5.0 
    @react-native-community/push-notification-ios: 1.2.0 => 1.2.0 
    @types/react: 16.9.35 => 16.9.35 
    amazon-cognito-identity-js: ^4.3.0 => 4.3.0 
    apollo-cache: ^1.3.5 => 1.3.5 
    apollo-cache-inmemory: ^1.6.6 => 1.6.6 
    apollo-client: 2.6.10 => 2.6.10 
    apollo-link: ^1.2.14 => 1.2.14 
    apollo-link-http: ^1.5.17 => 1.5.17 
    apollo-utilities: ^1.3.4 => 1.3.4 
    aws-appsync: ^3.0.3 => 3.0.3 
    aws-appsync-auth-link: ^2.0.2 => 2.0.2 
    aws-appsync-react: ^3.0.3 => 3.0.3 
    aws-appsync-subscription-link: ^2.1.0 => 2.1.0 
    babel-jest: ^24.9.0 => 24.9.0 
    bugsnag-react-native: ^2.23.7 => 2.23.7 
    eslint: ^6.5.1 => 6.8.0 
    graphql: 15.0.0 => 15.0.0 
    graphql-tag: ^2.10.3 => 2.10.3 
    jest: ^24.9.0 => 24.9.0 
    lodash.clonedeep: ^4.5.0 => 4.5.0 
    lodash.debounce: ^4.0.8 => 4.0.8 
    lodash.flowright: ^3.5.0 => 3.5.0 
    lodash.uniqby: ^4.7.0 => 4.7.0 
    metro-react-native-babel-preset: ^0.58.0 => 0.58.0 
    moment: ^2.25.3 => 2.25.3 
    moment-timezone: ^0.5.28 => 0.5.28 
    native-base: ^2.13.12 => 2.13.12 
    prop-types: ^15.7.2 => 15.7.2 
    react: 16.11.0 => 16.11.0 
    react-apollo: ^3.1.5 => 3.1.5 
    react-dom: ^16.12.0 => 16.13.1 
    react-native: 0.62.2 => 0.62.2 
    react-native-animatable: ^1.3.3 => 1.3.3 
    react-native-camera: ^3.24.1 => 3.26.0 
    react-native-circular-progress: 1.3.6 => 1.3.6 
    react-native-config: 1.0.0 => 1.0.0 
    react-native-country-picker-modal: ^1.10.0 => 1.10.0 
    react-native-device-info: ^5.5.7 => 5.5.7 
    react-native-fast-image: ^8.1.5 => 8.1.5 
    react-native-fs: ^2.16.6 => 2.16.6 
    react-native-gesture-handler: ^1.6.1 => 1.6.1 
    react-native-haptic-feedback: ^1.9.0 => 1.10.0 
    react-native-orientation-locker: ^1.1.8 => 1.1.8 
    react-native-permissions: ^2.1.4 => 2.1.4 
    react-native-progress: ^4.1.2 => 4.1.2 
    react-native-reanimated: ^1.8.0 => 1.8.0 
    react-native-safe-area-context: ^1.0.0 => 1.0.0 
    react-native-safe-area-view: ^2.0.0 => 2.0.0 
    react-native-screens: ^2.7.0 => 2.7.0 
    react-native-share: 3.3.2 => 3.3.2 
    react-native-svg: ^12.1.0 => 12.1.0 
    react-native-svg-animated-linear-gradient: https://github.com/joebernard/react-native-svg-animated-linear-gradient.git => 0.3.4 
    react-native-tab-view: ^2.14.0 => 2.14.0 
    react-native-vector-icons: ^6.6.0 => 6.6.0 
    react-native-video: ^5.0.2 => 5.0.2 
    react-native-webview: 9.4.0 => 9.4.0 
    react-navigation: ^4.3.9 => 4.3.9 
    react-navigation-props-mapper: ^1.0.4 => 1.0.4 
    react-navigation-stack: ^2.4.0 => 2.5.0 
    react-navigation-tabs: ^2.8.13 => 2.8.13 
    react-test-renderer: 16.11.0 => 16.11.0 
    uuid: ^3.4.0 => 3.4.0 
  npmGlobalPackages:
    npm: 6.14.4

Smartphone (please complete the following information):

  • Device: iPhone Xs Max
  • OS: iOS 13.4.1

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 16 (6 by maintainers)

Most upvoted comments

We had to abandon Facebook login due to this issue. It was a hard choice but the only way we could move forward.

Any update on this?

I have posted in the AWS forums here: https://forums.aws.amazon.com/thread.jspa?threadID=330020

Config.COGNITO_AUTHENTICATION_FLOW_TYPE === 'CUSTOM_AUTH'