Abdul Taleb
09/14/2021, 6:57 PMconst apiAuth = new sst.Auth(this, 'auth', {
cognito: {
userPool: myUserPool,
userPoolClient: myUserPoolClient,
},
identityPool: {
allowUnauthenticatedIdentities: false,
identityPoolName: `api-identity-pool-${scope.stage}`,
}
});
const api = new sst.Api(this, 'api', { ...with JWT or Cognito Authorizer.. });
apiAuth.attachUnauthPermissions([api]);
Frank
apiAuth.attachUnauthPermissions()
is used to grant unauthenticated users access to and IAM authorized Api endpointAbdul Taleb
09/14/2021, 7:07 PMFrank
Frank
Abdul Taleb
09/14/2021, 7:10 PMAbdul Taleb
09/14/2021, 7:10 PMAbdul Taleb
09/14/2021, 7:10 PMAbdul Taleb
09/14/2021, 7:11 PMFrank
sst.Auth
construct is meant to be used for APIs with IAM auth.Abdul Taleb
09/14/2021, 7:12 PMFrank
Frank
Abdul Taleb
09/14/2021, 7:15 PMcognito: true
Frank
Frank