jamlen
12/08/2021, 11:58 AMae0a40db-b854-46a6-87e9-000f18309f0c
but when I get the event.requestContext.authorizer.iam.cognitoIdentity.identityId
it returns me eu-west-2:5f9ee6e6-2291-457d-8f5a-10edf136cc14
and so how do I get the user sub from the logged in user cognitoIdentity?Gabriel Araújo
12/08/2021, 12:30 PMGabriel Araújo
12/08/2021, 12:31 PMGabriel Araújo
12/08/2021, 12:32 PMGabriel Araújo
12/08/2021, 12:47 PMimport { cognitoUtils } from '@serverless-stack/runtime'
[...]
const userIds = cognitoUtil.extractUserPoolInfoFromIdentityContext(context)
const userRole = cognitoUtil.extractAssumedRoleNameFromIdentityContext(context)
jamlen
12/08/2021, 2:02 PMFrank
Gabriel Araújo
12/08/2021, 8:00 PMFrank
import { s3 } from '@serverless-stack/runtime'
s3.bucket("my-bucket").upload(file);
Might be easier to come up with a good design after we collect more use cases from the community. What do you think? (cc @Jay @thdxr on this topic)Jay
uses
idea you had Frank. Do we have that in an issue somewhere? Maybe add to this issue with those details to collect some feedback?Frank
Jay
Jay