【问题标题】:Identity Server with Angular Silent Refresh POST denied带有 Angular 静默刷新 POST 的身份服务器被拒绝
【发布时间】:2020-05-22 09:27:57
【问题描述】:

我在 .NET Core 站点中使用 Identity Server 4,并使用它来处理带有 PCKE 的 Angular 应用程序的 OAUTH(使用 angular-oauth-oidc 库)。正常的登录过程可以正常工作,但是当网站尝试执行静默刷新时,它会向 http://identityServerURL/connect/token 发送 HTTP POST,其中包含标题:

  • grant_type:刷新令牌
  • client_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • 范围: openid profile offline_access
  • refresh_token: null
  • client_secret: xxxxxxxxxxxxxxxxxxxxx

从 IdentityServer 收到一个 Http 400 代码,并且从日志中显示不允许向该端点进行 HTTP POST。

是否有人对此有任何想法和/或如何让刷新令牌工作?

提前致谢

【问题讨论】:

    标签: angular identityserver4 angular-oauth2-oidc


    【解决方案1】:

    您遇到这种情况的最可能原因(我们不得不稍微猜测一下,因为我们没有针对您的情况的可重现场景...)是 a bug in the Angular library 阻止触发基于 iframe 的静默刷新如果您在服务上明确调用silentRefresh()

    setupAutomaticSilentRefresh() 方法不会遇到这个问题,因为 it 计划的刷新是使用refresh_tokens 的。

    目前没有好的解决方法。这是I dealt with it 至少可以防止您描述的错误的方法。

    【讨论】:

      猜你喜欢
      • 2020-10-16
      • 2020-01-15
      • 1970-01-01
      • 1970-01-01
      • 2018-08-18
      • 1970-01-01
      • 2012-04-15
      • 1970-01-01
      • 2019-02-18
      相关资源
      最近更新 更多