1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
I found out: I had to check the "Lambda proxy integration" checkbox in the Integration request of the method.
Then the Lambda can fetch the user info from the event object of the lambda handler (e.g. in Python):
event['requestContext']['authorizer']['claims']['cognito:groups']
(or: 'cognito:username', etc.)
Then I could query different databases according to which group the user belongs to.
Additional info: it is also possible to assume the user role from within the Lambda function, to make sure to access only what's the user is allowed to (by default only the Lambda function's role is assumed to execute actions); this is very well explained at https://www.youtube.com/watch?v=GDkkDUnICrs
répondu il y a 4 ans
Contenus pertinents
- demandé il y a un an
- demandé il y a 7 mois
- demandé il y a 2 mois
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 3 ans