Skip to content

feat(core,console): support blocking token issuance on jwt customizer errors#8426

Merged
darcyYe merged 25 commits intomasterfrom
yemq-jwt-customizer-block-issuance-on-error
Apr 2, 2026
Merged

feat(core,console): support blocking token issuance on jwt customizer errors#8426
darcyYe merged 25 commits intomasterfrom
yemq-jwt-customizer-block-issuance-on-error

Conversation

@darcyYe
Copy link
Copy Markdown
Contributor

@darcyYe darcyYe commented Mar 4, 2026

Summary

  • add blockIssuanceOnError to the JWT customizer config, schema, and OpenAPI surface for both access tokens and client credentials
  • preserve api.denyAccess() as access_denied while converting other JWT customizer runtime failures in blocking mode into localized OIDC invalid_request responses
  • default blockIssuanceOnError to enabled for newly created custom claims scripts in the console, while keeping existing scripts without a saved value on the legacy disabled default to avoid a breaking change
  • localize the custom claims script error prefix and the console error-handling hint across supported locales, and clean up the console action typing with a shared Action enum
  • update the core, schema, console, and integration coverage for blocking token issuance behavior in token exchange and client credentials flows

Testing

Unit tests, Integration tests
image
image
image
image
image

Checklist

  • .changeset
  • unit tests
  • integration tests
  • necessary TSDoc comments

@github-actions github-actions Bot added the feature Cool stuff label Mar 4, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

COMPARE TO master

Total Size Diff ⚠️ 📈 +36.92 KB

Diff by File
Name Diff
.changeset/pink-lemons-boil.md 📈 +841 Bytes
packages/console/package.json 📈 +67 Bytes
packages/console/src/assets/icons/error-handling.svg 📈 +646 Bytes
packages/console/src/pages/CustomizeJwt/CreateButton/index.tsx 📈 +63 Bytes
packages/console/src/pages/CustomizeJwt/CustomizerItem/index.tsx 📈 +63 Bytes
packages/console/src/pages/CustomizeJwt/utils/type.ts 📈 +21 Bytes
packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/InstructionTab/GuideCard/index.tsx 📈 +36 Bytes
packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/InstructionTab/index.tsx 📈 +2.7 KB
packages/console/src/pages/CustomizeJwtDetails/MainContent/SettingsSection/index.tsx 📈 +807 Bytes
packages/console/src/pages/CustomizeJwtDetails/MainContent/index.tsx 📈 +126 Bytes
packages/console/src/pages/CustomizeJwtDetails/index.tsx 📈 +50 Bytes
packages/console/src/pages/CustomizeJwtDetails/type.ts 📈 +17 Bytes
packages/console/src/pages/CustomizeJwtDetails/use-data-fetch.ts 📈 +50 Bytes
packages/console/src/pages/CustomizeJwtDetails/utils/format.test.ts 📈 +1.86 KB
packages/console/src/pages/CustomizeJwtDetails/utils/format.ts 📈 +246 Bytes
packages/core/src/middleware/koa-oidc-error-handler.test.ts 📈 +375 Bytes
packages/core/src/oidc/extra-token-claims.test.ts 📈 +1.6 KB
packages/core/src/oidc/extra-token-claims.ts 📈 +1.37 KB
packages/core/src/routes/logto-config/jwt-customizer.test.ts 📈 +12 Bytes
packages/core/src/routes/logto-config/logto-config.openapi.json 📈 +344 Bytes
packages/integration-tests/src/mocks/jwt-customizer.ts 📈 +31 Bytes
packages/integration-tests/src/tests/api/oidc/client-credentials-grant.test.ts 📈 +1.94 KB
packages/integration-tests/src/tests/api/oidc/token-exchange/index.test.ts 📈 +3.65 KB
packages/phrases/src/locales/ar/errors/oidc.ts 📈 +93 Bytes
packages/phrases/src/locales/ar/translation/admin-console/jwt-claims.ts 📈 +1.31 KB
packages/phrases/src/locales/de/errors/oidc.ts 📈 +100 Bytes
packages/phrases/src/locales/de/translation/admin-console/jwt-claims.ts 📈 +1.02 KB
packages/phrases/src/locales/en/errors/oidc.ts 📈 +83 Bytes
packages/phrases/src/locales/en/translation/admin-console/jwt-claims.ts 📈 +863 Bytes
packages/phrases/src/locales/es/errors/oidc.ts 📈 +98 Bytes
packages/phrases/src/locales/es/translation/admin-console/jwt-claims.ts 📈 +1.02 KB
packages/phrases/src/locales/fr/errors/oidc.ts 📈 +99 Bytes
packages/phrases/src/locales/fr/translation/admin-console/jwt-claims.ts 📈 +1.07 KB
packages/phrases/src/locales/it/errors/oidc.ts 📈 +106 Bytes
packages/phrases/src/locales/it/translation/admin-console/jwt-claims.ts 📈 +1.04 KB
packages/phrases/src/locales/ja/errors/oidc.ts 📈 +101 Bytes
packages/phrases/src/locales/ja/translation/admin-console/jwt-claims.ts 📈 +1.25 KB
packages/phrases/src/locales/ko/errors/oidc.ts 📈 +93 Bytes
packages/phrases/src/locales/ko/translation/admin-console/jwt-claims.ts 📈 +1 KB
packages/phrases/src/locales/pl-pl/errors/oidc.ts 📈 +95 Bytes
packages/phrases/src/locales/pl-pl/translation/admin-console/jwt-claims.ts 📈 +984 Bytes
packages/phrases/src/locales/pt-br/errors/oidc.ts 📈 +96 Bytes
packages/phrases/src/locales/pt-br/translation/admin-console/jwt-claims.ts 📈 +1002 Bytes
packages/phrases/src/locales/pt-pt/errors/oidc.ts 📈 +96 Bytes
packages/phrases/src/locales/pt-pt/translation/admin-console/jwt-claims.ts 📈 +1009 Bytes
packages/phrases/src/locales/ru/errors/oidc.ts 📈 +124 Bytes
packages/phrases/src/locales/ru/translation/admin-console/jwt-claims.ts 📈 +1.51 KB
packages/phrases/src/locales/th/errors/oidc.ts 📈 +131 Bytes
packages/phrases/src/locales/th/translation/admin-console/jwt-claims.ts 📈 +1.87 KB
packages/phrases/src/locales/tr-tr/errors/oidc.ts 📈 +85 Bytes
packages/phrases/src/locales/tr-tr/translation/admin-console/jwt-claims.ts 📈 +1020 Bytes
packages/phrases/src/locales/zh-cn/errors/oidc.ts 📈 +87 Bytes
packages/phrases/src/locales/zh-cn/translation/admin-console/jwt-claims.ts 📈 +856 Bytes
packages/phrases/src/locales/zh-hk/errors/oidc.ts 📈 +84 Bytes
packages/phrases/src/locales/zh-hk/translation/admin-console/jwt-claims.ts 📈 +856 Bytes
packages/phrases/src/locales/zh-tw/errors/oidc.ts 📈 +84 Bytes
packages/phrases/src/locales/zh-tw/translation/admin-console/jwt-claims.ts 📈 +856 Bytes
packages/schemas/src/types/logto-config/jwt-customizer.test.ts 📈 +103 Bytes
packages/schemas/src/types/logto-config/jwt-customizer.ts 📈 +48 Bytes

@darcyYe darcyYe force-pushed the yemq-jwt-customizer-block-issuance-on-error branch from d29a91e to fd3bdf5 Compare March 11, 2026 08:51
@github-actions github-actions Bot added size/xl and removed size/xl labels Mar 11, 2026
@darcyYe darcyYe force-pushed the yemq-jwt-customizer-block-issuance-on-error branch from 9a86acf to 402def3 Compare March 12, 2026 04:11
@github-actions github-actions Bot added size/xl and removed size/xl labels Mar 12, 2026
@darcyYe darcyYe force-pushed the yemq-jwt-customizer-block-issuance-on-error branch from 402def3 to 617a3a8 Compare March 24, 2026 03:22
@github-actions github-actions Bot added size/xl and removed size/xl labels Mar 24, 2026
@darcyYe darcyYe marked this pull request as ready for review March 24, 2026 04:37
Copy link
Copy Markdown
Contributor

@simeng-li simeng-li left a comment

Choose a reason for hiding this comment

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

core changes LGTM

@github-actions github-actions Bot removed the size/xl label Mar 28, 2026
darcyYe added 25 commits March 31, 2026 23:20
oidc-provider AccessDenied defaults to 400, which changes the
existing custom JWT denyAccess behavior.

Keep api.denyAccess as the access_denied exception when
blockIssuanceOnError is enabled by preserving the original
403 status in the custom JWT error path.
Copy link
Copy Markdown
Member

@gao-sun gao-sun left a comment

Choose a reason for hiding this comment

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

lgtm on changeset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

5 participants