【问题标题】:Do Keycloak and its different adapters implement the Openid Connect Backchannel logout specKeycloak 及其不同的适配器是否实现了 Openid Connect Backchannel 注销规范
【发布时间】:2020-05-03 21:20:57
【问题描述】:

Keycloak 确实支持反向通道注销,但它是否符合 Openid Connect 反向通道注销草案规范? https://openid.net/specs/openid-connect-backchannel-1_0.html

【问题讨论】:

    标签: openid-connect keycloak redhat-sso


    【解决方案1】:

    OpenID Connect Back-Channel Logout 在 Keycloak 12.0 中实现,shipped in December 2020

    早期版本仅实现了另一种专有机制。

    【讨论】:

    • 虽然此链接可能会回答问题,但最好在此处包含答案的基本部分并提供链接以供参考。如果链接页面发生更改,仅链接答案可能会失效。 - From Review
    【解决方案2】:

    这是Keycloak's Jira Issue 关于这个话题。去投票吧!

    在查看了规范和 Keycloaks 实现之后,我不得不说它不符合规范。例如,这是应该从 OP 发送到 RP 的所需注销令牌格式的差异:

    2.4。注销令牌

    OP 向 RP 发送一个类似于 ID 令牌的 JWT,称为注销令牌 要求他们注销。 ID 令牌在第 2 节中定义 [OpenID.Core]。

    在注销令牌中使用以下声明:

    iss
        REQUIRED. Issuer Identifier, as specified in Section 2 of [OpenID.Core]. 
    sub
        OPTIONAL. Subject Identifier, as specified in Section 2 of [OpenID.Core]. 
    aud
        REQUIRED. Audience(s), as specified in Section 2 of [OpenID.Core]. 
    iat
        REQUIRED. Issued at time, as specified in Section 2 of [OpenID.Core]. 
    jti
        REQUIRED. Unique identifier for the token, as specified in Section 9 of [OpenID.Core]. 
    events
        REQUIRED. Claim whose value is a JSON object containing the member name http://schemas.openid.net/event/backchannel-logout. This declares that the JWT is a Logout Token. The corresponding member value MUST be a JSON object and SHOULD be the empty JSON object {}. 
    sid
        OPTIONAL. Session ID - String identifier for a Session. This represents a Session of a User Agent or device for a logged-in End-User at an RP. Different sid values are used to identify distinct sessions at an OP. The sid value need only be unique in the context of a particular issuer. Its contents are opaque to the RP. Its syntax is the same as an OAuth 2.0 Client Identifier. 
    

    注销令牌必须包含 sub 或 sid 声明,并且可以 两者都包含。如果 sid 声明不存在,则意图是所有 由 iss 和 sub 标识的最终用户在 RP 上的会话 声明被注销。

    这就是 Keycloak 在其当前版本 (8.0.1) 中发送的内容:

    {
      "id": "3536c4c4-fa51-4691-bc09-d229df83f774-1579360301277",
      "expiration": 1579360331,
      "resource": "resource-server-1",
      "action": "LOGOUT",
      "adapterSessionIds": [
        "6569208C4937FD9C6E138C9DD9CF7C6F"
      ],
      "notBefore": 0,
      "keycloakSessionIds": [
        "ca8060fd-48e9-4d26-b2d6-d6edb095f4b7"
      ]
    }
    

    【讨论】:

      猜你喜欢
      • 2017-08-05
      • 2018-04-16
      • 2016-09-17
      • 2018-10-19
      • 2017-02-09
      • 2020-02-08
      • 2020-05-27
      • 2015-04-23
      • 2016-09-01
      相关资源
      最近更新 更多