After succesfully connecting RubyOnJets with a Cognito Userpool, we are able to login and access the different controllers. However I would like to know which user performed which task for auditing and other purposes. e.g., You are allowed to request leave, but only for yourself (obviously I can specify the user client side, but that is a security risk).
It would be nice if this was available through
event[‘requestContext’][‘authorizer’][‘claims’][‘username’]
event[‘requestContext’][‘authorizer’][‘claims’][‘sub’]
I believe this needs to be done in the API Gateway
Sorry, I seem to have forgotten that I had disabled it.
I found the data in
event[‘requestContext’][‘authorizer’][‘claims’][‘sub’]
event[‘requestContext’][‘authorizer’][‘claims’][‘cognito:username’]
event[‘requestContext’][‘authorizer’][‘claims’]['cognito:groups]
Cool, thanks.
That solves the issue of when event[‘requestContext’] would be nil
Do you have a way to add users/fetch a list of groups/users from cognito as well?
Or do I need to do the following
I am not sure what you are trying to do in your code example. Is this an admin interface to manage users in your pool and group? I would leave that to the AWS console.