Corrected the data type for ClaimsToAddOrOverride property in IdTokenGeneration and AccessTokenGeneration classes for CognitoPreTokenGenerationV2Event.
Issue #, if available: #1798 (additional context https://github.com/aws/aws-lambda-dotnet/discussions/1792)
Description of changes:
Corrected the data type for ClaimsToAddOrOverride property in IdTokenGeneration and AccessTokenGeneration classes for CognitoPreTokenGenerationV2Event.
Per Pre token generation Lambda trigger, following is the event structure for V2 event:
{
"request": {
"userAttributes": {
"string": "string"
},
"scopes": ["string", "string"],
"groupConfiguration": {
"groupsToOverride": ["string", "string"],
"iamRolesToOverride": ["string", "string"],
"preferredRole": "string"
},
"clientMetadata": {
"string": "string"
}
},
"response": {
"claimsAndScopeOverrideDetails": {
"idTokenGeneration": {
"claimsToAddOrOverride": {
"string": [accepted datatype]
},
"claimsToSuppress": ["string", "string"]
},
"accessTokenGeneration": {
"claimsToAddOrOverride": {
"string": [accepted datatype]
},
"claimsToSuppress": ["string", "string"],
"scopesToAdd": ["string", "string"],
"scopesToSuppress": ["string", "string"]
},
"groupOverrideDetails": {
"groupsToOverride": ["string", "string"],
"iamRolesToOverride": ["string", "string"],
"preferredRole": "string"
}
}
}
}
Notice that claimsToAddOrOverride for both idTokenGeneration and accessTokenGeneration has structure "string": [accepted datatype], where accepted datatype is one of the following:
- String
- Number
- Boolean
- Array of strings, numbers, booleans, or a combination of any of these
- JSON
IMPORTANT: This is a breaking change and should be called out explicitly in CHANGELOG.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.