Skip to content

chore(HNT-2502): stop accepting CognitoAdmin-Prod tokens#380

Merged
mmiermans merged 2 commits intomainfrom
HNT-2502-drop-cognito-admin-prod
Apr 23, 2026
Merged

chore(HNT-2502): stop accepting CognitoAdmin-Prod tokens#380
mmiermans merged 2 commits intomainfrom
HNT-2502-drop-cognito-admin-prod

Conversation

@mmiermans
Copy link
Copy Markdown
Contributor

@mmiermans mmiermans commented Apr 22, 2026

Goal

Stop accepting JWTs from the deprecated CognitoAdmin-Prod pool (us-east-1_1alKls4qw). Only MozillaAuthProxy-Prod and the Pocket JWK set remain. Less auth-flow complexity, less attack surface.

Investigation

Admin-api started accepting both pools in #150 (2022-06) so front-ends could migrate gradually. curation-admin-tools#840 (2024-07) was the last migration. Nothing active remains on the legacy pool:

  • No user-record modifications since 2024-07-23.
  • Refresh tokens are 30 days, so any leftover browser session expired by August 2024.
  • No matches for the legacy issuer or JWK kids in CloudWatch over the last 2 weeks.

App clients on the legacy pool:

Client Status
CurationAdminTools Replaced by the new-pool client in curation-admin-tools#840 (2024-07).
Backstage Pocket/backstage archived 2024-01; callback domains no longer resolve.
localhost-Prod-PKCE Replaced by localhost-curation-admin-tools on the new pool (2024-06).
AWSElasticsearch-server-log Dead; Elasticsearch no longer used.

Deployment steps

  • Pre-merge: confirmed no legacy-issuer JWT has reached admin-api in the last 2 weeks.
  • Post-merge: watch Sentry for ~1 week.
  • Follow-up: decommission CognitoAdmin-Prod in AWS (separate ticket).

References

The CognitoAdmin-Prod user pool (us-east-1_1alKls4qw) has been
deprecated in favor of MozillaAuthProxy-Prod (us-east-1_qYkccPmmu)
since admin-api#150 (2022-06). The curation-admin-tools frontend
completed its migration to the new pool in
curation-admin-tools#840 (2024-07), and the legacy pool has had
zero user-record modifications since 2024-07-23. No live clients
point at it.

Remove the legacy issuer from admin-api's accepted set so
expired/replayed tokens from that pool can no longer be used.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mmiermans mmiermans requested a review from a team as a code owner April 22, 2026 22:29
@mmiermans mmiermans requested review from jpetto and nina-py and removed request for a team April 22, 2026 22:29
Copy link
Copy Markdown
Collaborator

@jpetto jpetto left a comment

Choose a reason for hiding this comment

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

thanks for the clean up

Comment thread src/config.ts
environment: process.env.NODE_ENV || 'development',
},
auth: {
//Cognito is deprecated in favor of Mozilla Auth Proxy, but we still need to support it
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The "we still need to support it" statement was probably made because of a desire in 2022 to gradually migrate users to the new pool without disruption. The pool has no user activity since 2024.

Comment thread src/jwtUtils.ts
const keys = await Promise.all([
...getCognitoJwks(),
...getMozillaAuthProxyJwks(),
...getPocketJwks(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this could be removed too?

@mmiermans mmiermans merged commit 125abc2 into main Apr 23, 2026
7 of 8 checks passed
@mmiermans mmiermans deleted the HNT-2502-drop-cognito-admin-prod branch April 23, 2026 16:52
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.

2 participants