We are designing a asynchronous process. The flow of steps are,
- user login in using hosted cognito login form, ui receives the idToken
- user interacting with the form in UI - for ex: createUser
- ui invokes REST api gateway endpoint, and sends the idToken from cognito
- api gw validates the request with cognito using the idToken
- after this step, we want to enrich the data and add userId and role from idToken to data. (We want to do this after the authorization step, not from ui)
- api gw integrates with event bridge and send the command data to event bridge.
Need some suggestion on the step #4. How do we able to achieve this ?