I'm really struggling to add custom roles or groups in the JWT token generated by Cognito. I'm using the Pre-Token generation trigger in Cognito to execute a Lambda. I'm adding the "groupOverrideDetails" object in the response. Here is my final output:
"response": {
"claimsOverrideDetails": {
"claimsToAddOrOverride": {
"custom_attribute_key2": "attribute_value2",
"custom_attribute_key": "attribute_value"
}
},
"groupOverrideDetails": {
"groupsToOverride": [
"developers"
],
"iamRolesToOverride": [
"S3_Access_Admin"
],
"preferredRole": "S3_Access_Admin"
}
}
But in my JWT token, I do not see any above mentioned roles or groups.
- Can you please tell me what am I missing?
- Secondly, is it important to have "developers" group and "S3_Access_Admin" role to actually exist in AWS? What if I need to add a custom group in AWS?