Reputation: 1706
Currently, I have a nodeJS API server that handles user authentication that I would like to continue using. I have an /authenticate
endpoint that will authenticate users and return JWT that needs to be used for making authenticated API calls.
I would like to use AWS Cognito + DynamoDB for user authentication going forward. However, I'm totally overwhelmed by the various ways in which I can do this. I have come up with the following 2 ways of doing this, but not sure which is better in the long term.
Or, is there another, better way? In summary, I have a REST API using nodeJS that I want to deploy on AWS but not sure the best way to do so. One of those endpoints is for authentication, while the others are all CRUD.
Upvotes: 2
Views: 726
Reputation: 5572
Another good example application for what you are describing is here: https://github.com/awslabs/aws-serverless-auth-reference-app
It demonstrates, API-gateway, cognito, lamdda and dynamoDB working together for a room reservation application.
Upvotes: 0
Reputation: 173
I found an example of how to use cognito + Javascript: http://docs.aws.amazon.com/amazondynamodb/latest/gettingstartedguide/GettingStarted.Js.Summary.html "Configure AWS Credentials in Your Files Using Amazon Cognito"
Upvotes: 1
Reputation: 1599
So if I understand you correctly you want to look at how you can continue using the JWT approach you have but use DynamoDB as the backing store and the cognito capabilities to help with all the auth etc?
Maybe have a look at how to use Lambda, Cognito and DynamoDB with your own user management scheme
If you need any extra info just ask.
Upvotes: 1