AWS Amplify and AWS Cognito: Website subscription verification

0

I have an Angular-based website in which users can subscribe to various services. In Cognito, I see that custom attributes can be associated with users, but I don't see how to verify those attributes on each API request. Would I use a trigger, for instance, to check the user's subscriptions? If so, could I get some guidance on how to do that? Thanks.

AWS
已提问 2 年前416 查看次数
1 回答
4

Hi, standard and custom attributes will be included in user's id-token. you will need to pass this token to your APIs or backend, verify token signature, decode the token and then manually verify the value of attributes (like subscriptions).

If you are using API Gateway then you need a lambda authorzer, where you can do this token validation and verification of the claims. here is an example of lambda authorizer.

AWS
专家
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则