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 年前檢視次數 413 次
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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南