chalice icon indicating copy to clipboard operation
chalice copied to clipboard

fix: use correct key for cognito username

Open kapilt opened this issue 3 years ago • 1 comments

Description of changes:

local cognito auth is broken, due to using an incorrect claim key for username, its not clear where the previous value comes from all cognito jwt payload docs point to username.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

kapilt avatar Feb 19 '22 19:02 kapilt

I think this might be the difference between the ID token, which appears to use the cognito:username key (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-id-token.html) vs. the access token, which uses username (https://docs.aws.amazon.com/cognito/latest/developerguide/amazon-cognito-user-pools-using-the-access-token.html).

Maybe we can just check for both, but I think we still need to support cognito:username.

jamesls avatar Mar 15 '22 18:03 jamesls