Skip to content
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

Change Cognito JWT authorizer to use the right Client ID #4

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

casewalker
Copy link
Collaborator

On the last commit, I forgot that I had hard-coded the Cognito User Pool's "App Integration - Client ID" lower in the serverless config. This commit pulls the value out into a constant and updates it to the new value for the new User Pool.

@@ -24,7 +25,7 @@ provider:
type: jwt
identitySource: $request.header.Authorization
issuerUrl: "https://cognito-idp.us-east-1.amazonaws.com/${self:provider.environment.COGNITO_USER_POOL}"
audience: [ 4bfgopjuh6lmgg4t66qf9uphrb ]
audience: [ "${self:provider.environment.COGNITO_APP_CLIENT_ID}" ]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question to make sure i understand - the old audience was an older user pool and the new value above is for the new user pool that's actually in use?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly, within a User Pool you can create an App Client, and this is the bridge between Cognito and the application that uses Cognito for authentication. When I deleted the old User Pool and created a new one to fix MFA issues, I then also had to create a new App Client in the new User Pool and I forgot to update that config here.

@casewalker casewalker merged commit 58ef79d into main Nov 14, 2023
1 check passed
@casewalker casewalker deleted the fix-client-id branch November 14, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants