@kne/fastify-oidc 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/libs/idp/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ npm i --save @kne/fastify-oidc
|
|
|
66
66
|
|
|
67
67
|
| 资源 | identifier | scope | 用途 |
|
|
68
68
|
|------|------------|-------|------|
|
|
69
|
-
| 本项目 API | `${ORIGIN}/api` | `api` | SPA 调用本项目接口 |
|
|
69
|
+
| 本项目 API(名称为 `name`) | `${ORIGIN}/api` | `api` | SPA 调用本项目接口 |
|
|
70
70
|
| 服务接口 | `${issuer origin}${prefix}` | `user:read tenant:read` | 子项目以 client_credentials 读取用户 / 租户 |
|
|
71
71
|
|
|
72
72
|
client 只能申请 `allowedResources` 中的资源;子项目 token 的 `aud` 是子项目 API,拿到主项目会被拒绝。
|
package/libs/idp/index.js
CHANGED
|
@@ -45,7 +45,7 @@ module.exports = ({ fastify, options, translator }) => {
|
|
|
45
45
|
const resourceServers = [...(options.resourceServers || [])];
|
|
46
46
|
const clients = [...(options.clients || [])];
|
|
47
47
|
if (options.seedSelf) {
|
|
48
|
-
resourceServers.push({ identifier: runtime.audience, name:
|
|
48
|
+
resourceServers.push({ identifier: runtime.audience, name: options.name });
|
|
49
49
|
resourceServers.push({ identifier: runtime.serviceAudience, name: 'OIDC 服务接口', scope: options.serviceScopes.join(' ') });
|
|
50
50
|
clients.push(
|
|
51
51
|
Object.assign(
|