I am using amazon-Cognito-identity-js
and aws-sdk
to setup authentication in my nodeJs app.
What i did
First i signup using userpool.signUp(..)
method according to docs.
Then i confirmed the verification code using cognitoUser.confirmRegistration(..)
method according to docs.
Up to here, everything works fine. But, now i would like to get all attributes of the user. I found a method cognitoUser.getUserAttributes(..)
which can give me attributes. But when i call this method after cognitoUser.confirmRegistration(..)
then it returns Error: User is not authenticated.
I went through a SO question where I got
getCurrentUser()
will return null at backend side.
So, how can I authorize any user at the fully secured backend side using nodejs?