Update the code backing the new metrics API so that unauthenticated users can be tracked between requests/file downloads/file uploads.
To do so:
Update Lambda function which populates the Timestream database. For unauthenticated users, it needs to store event["userIdentity"]["sessionContext"]["webIdFederationData"]["attributes"]["cognito-identity.amazonaws.com:sub"]. That is the identity ID obtained for the user from the Cognito Identity Pool.
Update the CLI to store the identity ID across requests for unauthenticated users. To do so, send the identity ID back with the credentials, store it with the credentials, and then send the identity ID back when getting new credentials. Clear the identity ID if the user then authenticates.
Update the web API to store the identity ID in the session for unauthenticated users. Use the ID when getting new credentials. Clear the identity ID if that user then authenticates.
Update the code backing the new metrics API so that unauthenticated users can be tracked between requests/file downloads/file uploads.
To do so:
event["userIdentity"]["sessionContext"]["webIdFederationData"]["attributes"]["cognito-identity.amazonaws.com:sub"]
. That is the identity ID obtained for the user from the Cognito Identity Pool.