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
preguntada hace 2 años413 visualizaciones
1 Respuesta
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
EXPERTO
respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas