【问题标题】:angular-auth-oidc-client keycloak does not workangular-auth-oidc-client 密钥斗篷不起作用
【发布时间】:2022-01-13 23:32:58
【问题描述】:

我正在使用 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 应用程序也已停止工作。

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

keycloak 设置为最新

【问题讨论】:

    标签: angular authentication keycloak angular-auth-oidc-client


    【解决方案1】:

    您本地机器上的时间/时钟和您的 docker 容器似乎不同步。

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

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

    【讨论】:

    • 感谢您的帮助:D
    • @MahmoudEl-Yamani 如果可行,请您接受答案。谢谢。
    猜你喜欢
    • 2021-01-22
    • 2021-10-30
    • 2021-08-02
    • 2016-11-15
    • 2018-07-08
    • 2023-02-10
    • 2023-01-13
    • 1970-01-01
    • 2018-11-13
    相关资源
    最近更新 更多