@haneinfo/oidc-auth (英语)
OIDC交互式认证和入境授权(RFC 8693)为Haneinfo NestJS应用程序进行符号验证.
建筑(6.0)
- 单一交互式核查路径数字 :
JwtVerifierService.verifyJwtToken(token)是交互式无记名符号的唯一核查入口(用于:OidcInteractiveStrategy财务报告和审定财务报表@haneinfo/plugin-host-nest是因为InteractiveAuthGuard) (中文(简体) ). - IAM 概况合同数字 :
issuer, (中文(简体) ),jwksUri(通过)getTrustedMetadata()),签名算法授权列表(signingAlgorithms,并声称正常化(normalizeClaims('web', payload, header)所有来自注射器IAM_PROFILE(单位:千美元)IamProfilePort,能力haneinfo.iam-profile) (中文(简体) ). - 观众和客户端分离页:1
web.apiAudience)和Web RP客户端ID(web.clientId)来自部署配置(IamDeploymentConfig),并由IAM_PROFILE执行,而不是OIDC_AUDIENCE或者说azp === audience。 。 。 . - 切换时间戳验证数字 :
iat财务报告和审定财务报表exp边距( e)clockToleranceSeconds, (中文(简体) ),maxIssuedLifetimeSeconds() 由@haneinfo/plugin-api是因为validateTokenTimestamps。 。 。 .
从 5.x 迁移到 6.0
删除的环境变量和导出
OIDC_ISSUER, (中文(简体) ),OIDC_AUDIENCE财务报告和审定财务报表OIDC_JWKS_URL不再读取.oidcAuthConfigFromEnvironment被删除,以及oidcAuthConfigSchema现在z.object({}).strict()。 。 。 .- 护照路径被移除 :
OidcStrategy, (中文(简体) ),JwtAuthGuard,则passport, (中文(简体) ),passport-jwt财务报告和审定财务报表@nestjs/passport依赖性。 使用InteractiveAuthGuard从@haneinfo/plugin-host-nest换句话说. JwtVerifierService.buildOidcJwtUser删除。 它从未验证的有效载荷上造出主力.
新的所需能力
requires现在包括haneinfo.iam-profile(单位:千美元)CAPABILITY_IAM_PROFILE),以及engine.haneinfoPluginApi实值^1.29.0。 。 。 .
变动至 haneinfo.config.ts
设定 runtime.oidc 改为 {},然后添加 @haneinfo/iam-keycloak/plugin, (中文(简体) ), runtime.iam 财务报告和审定财务报表 iam.deployment编辑 @haneinfo/plugin-host-nest README有细节.
import { iamKeycloakPlugin } from '@haneinfo/iam-keycloak/plugin';
import { oidcAuthPlugin } from '@haneinfo/oidc-auth/plugin';
import type { IamDeploymentConfig } from '@haneinfo/plugin-api';
import { defineHaneinfoConfig } from '@haneinfo/plugin-host-nest';
// Single source of truth for profileId, issuer, capabilities, web.apiAudience and web.clientId.
const iamDeployment: IamDeploymentConfig = {
/* ... */
};
export default defineHaneinfoConfig({
inventory,
plugins: [{ plugin: iamKeycloakPlugin }, { plugin: oidcAuthPlugin } /* , ... */],
iam: { deployment: iamDeployment },
runtime: {
iam: iamDeployment,
oidc: {},
},
});
DelegatedAuthModule 变动
DelegatedAuthModule.forFeature(options)不再接受一个oidc选项,不再读OIDC_JWKS_URL。 。 。 .DelegatedJwtVerifierService注射数IAM_PROFILE在第一次核实时,它写着:jwksUri从getTrustedMetadata()并检查它与validateDelegatedJwksUrl。 。 。 .- Apps必须制造
IAM_PROFILE可通过options.imports,加上PrismaService, (中文(简体) ),IDENTITY_STORE财务报告和审定财务报表AUDIT_SINK。 。 。 . - O3 启动门数字 :
DelegatedAuthModule检查IAM_PROFILE.mcpCapabilities.delegation启动时拒绝启动,除非是true(跨应用程序授权O3未启用,因此授权的切入点不得注册).
尚未迁移(第2W7阶段)
模板、应用软件和 @haneinfo/app-tooling (例如 packages/app-tooling/src/scaffold.ts 和它的测试)仍然使用这些名字. 他们在第二阶段W7中迁移:
OIDC_ISSUEROIDC_AUDIENCEOIDC_JWKS_URL