0

In one of my applications, I am federating users from the client's ADFS into my Cognito user pool. For this, I have imported metadata files from the client's ADFS into the SAML identity provider in my Cognito pool.

With this arrangement, the AD users are able to log in with their credentials, and the corresponding users are created into the Cognito pool with source 'EXTERNAL_PROVIDER'. So far so good.

However, I also need to save the data of these users in one of my databases. I am, therefore, looking for a trigger that can be invoked when any such user is being migrated from External sources so that I can use that trigger to save the user to my DB.

Interestingly, I found that there is a Cognito trigger called 'Migrate User Lambda Trigger' which by its documentation seems to do the exact same thing.

From the doc here

When a user doesn't exist in the user pool at sign-in with a password, or in the forgot-password flow, Amazon Cognito invokes this trigger. After the Lambda function returns successfully, Amazon Cognito creates the user in the user pool.

I have tried using this lambda trigger but unfortunately, it doesn't get triggered for any federated user.

Am I missing something here, or is this triggered meant to do something else? Any suggestions or links are welcome.

Ismaili Mohamedi
  • 906
  • 7
  • 15
Saurabh Tiwari
  • 4,632
  • 9
  • 42
  • 82

0 Answers0