0

我正在将 docker-compose 与 Angular 应用程序和 keycloak 身份验证服务器一起使用。我今天从 keycloak 中提取了一个新图像,我所有的 Angular 应用程序都崩溃了。

这是调试 angular-auth-oidc-client 时的消息

[DEBUG] 0- - Getting signinkeys from  https://*****.com/auth/realms/****/protocol/openid-connect/certs
[DEBUG] 0- - Did not find any configured route for route https://*****.com/auth/realms/****/protocol/openid-connect/certs
[DEBUG] 0- - validate id token iat max offset -7315000 < 120000
[DEBUG] 0- - authCallback token(s) invalid

角度误差

ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'unauthorized'

我的 angular-auth-oidc-client 设置

config: {
    secureRoutes: ['/'],
    authority: 'https://*****/auth/realms/*****',
    redirectUrl: window.location.origin,
    postLogoutRedirectUri: '*****',
    clientId: 'kn-pharmacy',
    scope: 'openid profile offline_access ', // 'openid profile offline_access ' + your scopes
    responseType: 'code',
    silentRenew: true,
    useRefreshToken: true,
    renewTimeBeforeTokenExpiresInSeconds: 30,
    logLevel: LogLevel.Debug,
    ignoreNonceAfterRefresh:true
  },

我试图为我的 Angular 项目重做我的最后一次提交,但这并没有解决问题。以及其他三个在 keycloak 服务器上中继的 Angular 应用程序也已停止工作。

目前我正在使用 Angular@12.2.13, angular-auth-oidc-client@12.0.3

keycloak 设置为最新

4

1 回答 1

2

看起来您本地机器上的时间/时钟和您的 docker 容器不同步。

[DEBUG] 0- - validate id token iat max offset -7315000 < 120000

我会像您允许 120 秒的偏移量一样阅读此内容,但实际上时间相差 7315 秒。

于 2022-01-13T15:32:58.747 回答