【问题标题】:Silent Renew using oidc-client in case SameSite=Lax在 SameSite=Lax 的情况下使用 oidc-client 进行静默续订
【发布时间】:2020-04-14 16:15:40
【问题描述】:

Chrome 计划在 2020 年 2 月为 Chrome 80 实施新的默认安全模型。 现在我正在测试我们所有可能受到影响的应用程序。

对于身份验证/授权,我们在后端使用 oidc-client(在 UI 上)和 IndentityServer。

工作流程如下:

请求

发布http://my_identity_server/api/authenticate {用户名,密码}

回复

设置 Cookie:idsrv=abc

{"redirectUrl":"http://my_identity_server/connect/authorize/callback?client_id=MyApplication&response_type=id_tokentoken&scope=openid"}

请求

http://my_identity_server/connect/authorize/callback?client_id=MyApplication&response_type=id_tokentoken&scope=openid" Cookie:idsrv=abc

回复

302 位置:http://myApplication/#id_token=123&access_token=456&token_type=Bearer

请求

http://myApplication/#id_token=123&access_token=456&token_type=Bearer

当应用程序被加载时,Oidc-client 添加 IFrame 来执行实际上发送额外请求

的silentRenew

GET http://my_identity_server/connect/authorize?client_id=MyApplication&response_type=id_token token&prompt=none Cookie:idsrv=abc

我不明白为什么最后一个请求在 IFrame 中包含 idsrv cookie? 该请求是在 IFrame 内完成的,它绝对是第三方 cookie。 如果我将 SameSite 设置切换为“严格”,一切都按预期工作,cookie 不会发送。

如果有人可以向我解释这个案例或提出一些想法来检查,那就太好了!谢谢!

【问题讨论】:

    标签: identityserver4 oidc-client-js samesite


    【解决方案1】:

    OIDC 客户端库使用 OIDC 会话管理来跟踪使用 OP iframe 和 client(RP) iframe 完成的会话。

    身份服务器为此目的发出 idsrv:session cookie

    检查这个 https://medium.com/@piraveenaparalogarajah/openid-connect-session-management-dc6a65040cc

    【讨论】:

      猜你喜欢
      • 2019-12-22
      • 2020-12-03
      • 2018-06-13
      • 1970-01-01
      • 2020-11-25
      • 2021-08-21
      • 2020-05-16
      • 2018-03-28
      • 2020-06-07
      相关资源
      最近更新 更多