- Newest
- Most votes
- Most comments
Based on my understanding of your question. you have two types of users
- Guest users (unauthenticated) - these users can access some of your services.
- Authenticated users - you need the user to authenticate before they pay for your services.
Cognito provide both unauthenticated and authenticated users. Moreover , Cognito can also switch the unauthenticated users to authenticated users with the same unique identifier. please check this for more details - https://docs.aws.amazon.com/cognito/latest/developerguide/switching-identities.html.
I would recommend to use Dynamo DB for payment status , you can use user unique id in Dynamo DB to map it with the users in user pool.
Hi,
Have a read at this: https://repost.aws/knowledge-center/api-gateway-cognito-user-pool-authorizer as it covers and links to official guides about setting it up.
Finally this is more a comprehensive guide with tutorials and hands on workshops. https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-tutorials.html
Hope it helps ;)
API Gateway and Cognito do not provide a way for doing what you want. Further more, as you want to be able to give your uses some number of free APIs, you need to know who they are.
I would recommend that you use Cognito for user registration and authentication, API Gateway for enforcing the credentials and the Lambda function to implement the business logic, that will include also counting calls and saving the information to Dynamo DB, which then can be used for charging.
Relevant content
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
thanks. but i think i can hold payment status on cognito user pool. i will try it this later because i am in the beginning of the development. by the way i have an rds but also can hold a dynamodb for payment status
While you can have ways to store payment status in user pool but as a best practice you should keep payment information separate from user information. This helps to scale your application better.