gpt4 book ai didi

cookies - SameSite 属性中断 SAML 流程

转载 作者:行者123 更新时间:2023-12-04 00:01:56 28 4
gpt4 key购买 nike

Chrome 80 将引入一个新属性,即 SameSite。

  • 严格 - 只为“同一站点”请求附加 cookie。
  • 松散 - 发送“同站点”请求的 cookie,以及使用安全 HTTP 方法的“跨站点”顶级导航,例如(获取头部选项跟踪)。
  • 无 - 为所有“同一站点”和“跨站点”请求发送 cookie。

  • 更多信息, this article很好地解释了 SameSite。

    从 Azure 文档:

    The cloud service (the service provider) uses an HTTP Redirect binding to pass an AuthnRequest (authentication request) element to Azure AD (the identity provider). Azure AD then uses an HTTP post binding to post a Response element to the cloud service



    我的问题是为什么 SameSite 会破坏 SAML 流程? 🔍"saml" samesite problem

    当 IdP POST 响应回 SP 时,如果 SameSite=Lax,用户代理将不会发送具有 SP 域的 cookie。即使它不发送 cookie,我也不认为 SP 有任何问题。

    最佳答案

    When IdP POST response back to SP, if SameSite=Lax, user-agent will not send cookies that has SP domain. Even if it does not send cookies I don't see there is any problem with SP.



    在 IdP-init 上,可能不会有任何问题,因为在发送的 SAML 响应之外没有任何状态。

    但是,SP-init 流很可能会被破坏。原因是大多数 SP 产品通过它在将用户发送到 IdP 之前设置的 cookie 跟踪浏览器 session 。浏览器被重定向到 IdP,进行身份验证,然后通过 POST 响应将其发送回 SP。如果 cookie 没有设置为 SameSite=None;Secure (不要忘记 - 需要 SameSite=None 的 cookie 也必须设置为 Secure ),那么 SP 的 cookie 将不会通过 POST 传递回 SP,从而使 SP 没有所有安全配置 session 所需的部分。

    一种看待它的方式是,用户需要两组 key 来在 SP 建立安全 session :第一个是它希望从 cookie 中获取其 session key ,另一个是它希望从 IdP 中获取 key .

    关于cookies - SameSite 属性中断 SAML 流程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60068271/

    28 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com