Amazon-cognito-identity-js: Getting UUID of user through Lambda triggers

Created on 30 Sep 2016  路  7Comments  路  Source: amazon-archives/amazon-cognito-identity-js

I am trying to grab the sub/UUID of the user on my backend to populate our Dynamo tables with info about the user and thought the Post-confirm lambda trigger would be the best to do this, however I saw that the sub of the user is not actually passed into the request.

my request going to lambda looks like this:

``` request='
{
"version": "1",
"region": "us-west-2",
"userPoolId": "us-west-2_MDYcBLq07",
"userName": "[email protected]",
"callerContext": {
"awsSdkVersion": "aws-sdk-js-2.6.4",
"clientId": "1uoosl4dn2bvgvqo1n4om4toig"
},
"triggerSource": "PostConfirmation_ConfirmSignUp",
"request": {
"userAttributes": {
"phone_number": null,
"email": "[email protected]"
}
},
"response": {}
}

```

Kind of a bummer that the sub is not sent along with the userAttributes Object...

Are there any lambda triggers that would send the sub of the user in the request? If not, how can I query my UserPool from my backend (Java) to get the UserId of a user whose username/email I have?

Most helpful comment

But then, the question arises.. how to get the identity id on sign up?

All 7 comments

We are aware of this problem and are working to solve this. We will soon enable our flow to pass all current user attributes to all lambda triggers. Apologies for any inconvenience.

Thanks @chetanme. Do you think it will be enabled within the next few months? If not, I may need to find another solution to deliver the uuid to my lambda code.

We can't comment on exact timelines but as per the current road map, this will be enabled withing next few months.

So it looks like the updates have been made?

Yes. Now all lambda triggers receive all exiting user attributes.

But then, the question arises.. how to get the identity id on sign up?

@chetanme Any workaround for getting the identity id?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sarah-pixvana picture sarah-pixvana  路  4Comments

howardya picture howardya  路  3Comments

daordonez11 picture daordonez11  路  5Comments

hscheckenbacher picture hscheckenbacher  路  5Comments

RashmiPandey picture RashmiPandey  路  4Comments