Thirumal
Thirumal

Reputation: 9606

How to implement RBAC (Role-Based Access Control) in AWS Cognito with Serverless Lambda functions?

How to implement RBAC (Role-Based Access Control) in AWS Cognito with Serverless Lambda functions?

Most of the tutorial explains, attach IAM roles/policies and API Gateway,

Eg: http://12.in/list/employees

The above authorization works well, the system is only for one subscriber/organization.

How to implement the authorization in multiple subscriber/organization environments?

http://12.in/list/{org_id}/employees

Is it possible with Cognito?

Upvotes: 0

Views: 976

Answers (1)

Andrew Gillis
Andrew Gillis

Reputation: 3885

You can safely authorize with any of the claims you include in the token. That offers two places to easily add your user-to-org mapping.

  1. As a custom user attribute (make sure it is immutable).
  2. As a custom claim in a pre-token-generation trigger.

Upvotes: 1

Related Questions