-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for Cognito pre token generation with access token customization #538
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f6add2e
Fixed Cognito service name and added event structure for Cognito pre …
AMZ-brandon 561c62a
Merge branch 'main' into main
bmoffatt 849ad2a
gofmt -s -w .
bmoffatt 013dc2d
Add sample data and serde test
bmoffatt 453a56b
Tweak the test data to avoid having to break response marshaling comp…
bmoffatt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
events/testdata/cognito-event-userpools-pretokengen-v2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"version": "2", | ||
"triggerSource": "TokenGeneration_Authentication", | ||
"region": "us-west-2", | ||
"userPoolId": "us-east-1_EXAMPLE", | ||
"userName": "brcotter", | ||
"callerContext": { | ||
"awsSdkVersion": "aws-sdk-unknown-unknown", | ||
"clientId": "1example23456789" | ||
}, | ||
"request": { | ||
"userAttributes": { | ||
"sub": "a36036a8-9061-424d-a737-56d57dae7bc6", | ||
"cognito:email_alias": "testuser@example.com", | ||
"cognito:user_status": "CONFIRMED", | ||
"email_verified": "true", | ||
"email": "testuser@example.com" | ||
}, | ||
"groupConfiguration": { | ||
"groupsToOverride": [], | ||
"iamRolesToOverride": [], | ||
"preferredRole": null | ||
}, | ||
"scopes": [ | ||
"aws.cognito.signin.user.admin" | ||
] | ||
}, | ||
"response": { | ||
"claimsAndScopeOverrideDetails": { | ||
"idTokenGeneration": { | ||
"claimsToAddOrOverride": { | ||
"family_name": "xyz" | ||
}, | ||
"claimsToSuppress": [ | ||
"email", | ||
"birthdate" | ||
] | ||
}, | ||
"accessTokenGeneration": { | ||
"claimsToAddOrOverride": { | ||
"family_name": "xyz" | ||
}, | ||
"claimsToSuppress": [ | ||
"email", | ||
"birthdate" | ||
], | ||
"scopesToAdd": [ | ||
"scope1", | ||
"scope2", | ||
"scopeLomond" | ||
], | ||
"scopesToSuppress": [ | ||
"phone_number" | ||
] | ||
}, | ||
"groupOverrideDetails": { | ||
"groupsToOverride": [ | ||
"group-A", | ||
"group-B", | ||
"group-C" | ||
], | ||
"iamRolesToOverride": [ | ||
"arn:aws:iam::123456789012:role/sns_callerA", | ||
"arn:aws:iam::123456789012:role/sns_callerB", | ||
"arn:aws:iam::123456789012:role/sns_callerC" | ||
], | ||
"preferredRole": "arn:aws:iam::123456789012:role/sns_caller" | ||
bmoffatt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the doc fixes too!