logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.5k stars 419 forks source link

feat(core): organization token for token exchange flow #6106

Closed wangsijie closed 3 months ago

wangsijie commented 3 months ago

Summary

Implement organization token for "token exchange": if organization_id param is set, will return organization token.

There are some similar code in current 3 grants, created an issue LOG-9191 to track, will refactor them before release.

Testing

Unit and integration tests.

Checklist

github-actions[bot] commented 3 months ago

COMPARE TO master

Total Size Diff :chart_with_upwards_trend: +9.32 KB

Diff by File |Name|Diff| |---|---| |packages/core/src/oidc/grants/token-exchange.test.ts|:chart_with_upwards_trend: +3.39 KB| |packages/core/src/oidc/grants/token-exchange.ts|:chart_with_upwards_trend: +2.31 KB| |packages/integration-tests/src/tests/api/oidc/token-exchange.test.ts|:chart_with_upwards_trend: +3.62 KB|