Skip to content

Horizon logout doesn't logout federated OIDC user (in proxy realm setup) #347

Closed

Description

@reqa

As a federated OIDC user, I want Horizon logout to also logout from the OIDC IdP so that I need to enter a password again instead of automatic re-use the access token from the cookie.

Current Situation: @JuanPTM has created a PoC setup with Federation to a Keycloak "Proxy realm" ("OSISM") and configuring the Keycloak extension https://github.com/sventorben/keycloak-home-idp-discovery to route the user to the customer-specific Keycloak realm based on their email.

Login Flow:

  • Open https://api.testbed.osism.xyz/auth/login/?next=/ and select "Authenticate with Keycloak"
  • Click on "Sign In" in that Horizon Login page gets you redirected to Keycloak "OSISM" realm
  • Keycloak displays "OSISM" : "Sign in to your account" : "Username or email"
  • Enter your email (e.g. [email protected]) and click on "Sign In"
  • Keycloak redirects you to the realm "TEST" (based on domain part of email) and asks you for the password
  • After entering the correct password, the redirects cascade you back to Horizon and you are logged in.
    Logout:
  • In Horizon click on "Sign Out"
    Re-Login:
  • Try to re-login int Horizon by "Authenticate with Keycloak"
    Expected result:
  • Needing to re-authenticate
    Actual behavior:
  • You are directly logged in

Plan of work:

  • Look into the network flow in the browser developer console to see what happens during logout.
  • Find out if this problem arises only with this "Proxy realm" setup or does it also affect the "traditional" Keycloak federation? (In that case: What does OpenStack say about this?)
  • Find out how this would need to work in theory (backchannel logout? In both OSISM and TEST realm?)
  • Fix it.

Definition of Ready:

  • User Story is small enough to be finished within one sprint
  • User Story is clear and understood by the whole team
  • Acceptance criteria are defined
  • Acceptance criteria are clear and understood by the whole team

Definition of Done:

  • All acceptance criteria are met
  • Changes have been reviewed
  • CI tests have run successfully
  • Documentation has been updated
  • Release Notes have been updated

Activity

  1. added
    IAM
    on Jun 14, 2023
  2. self-assigned this
    on Jun 14, 2023
  3. reqa commented on Jun 14, 2023

    @reqa
    Author

    We noticed from experiment that

    1. We are also still "logged in" after logout, even when we additionally remove the sessions in Keycloak (as admin). So that looks more like a thing between user browser and keystone?

    2. The cookie mod_auth_openidc_session seems to be the credential that keeps us logged in even after logout. That cookie remains in the browser storage and if we remove that too then transparent re-login is not performed any longer.

    3. At first glance it doesn't seem to be related on the "second OIDC hop" from the Keycloak "proxy realm" to the customer-specific realm.

    This suggests that maybe mod_auth_openidc either doesn't get informed of the horizon logout or it doesn't properly handle it.

    Maybe interesting info:

  4. moved this from Backlog to Doing in Sovereign Cloud Stackon Jun 21, 2023
  5. JuanPTM commented on Jun 23, 2023

    @JuanPTM

    After today SIG meeting, I use the propose from @jnull to improve the solution 2 into a new one.

  6. added
    Sprint Hobart
    on Jul 27, 2023
  7. garloff commented on Aug 9, 2023

    @garloff
    Member

    Will need to go to osism/cfg-generics after successful test on testbed.

  8. JuanPTM commented on Aug 21, 2023

    @JuanPTM

    There is a merge request in the testbed to fix the logout corner cases ( SIG IAM 11-08)
    osism/testbed#1717

  9. added
    Sprint Izmir
    on Aug 23, 2023
  10. JuanPTM commented on Sep 1, 2023

    @JuanPTM

    Merged

  11. JuanPTM commented on Sep 6, 2023

    @JuanPTM

    Found a new issue on a fresh testbed deploy. A PR has been created on the testbed to fix it. MR testbed

    Issues:

    • Errors on url strings
    • Missing traefik certificate on keycloak, producing an error during logout redirect.
  12. JuanPTM commented on Sep 11, 2023

    @JuanPTM

    PR has been merged

  13. garloff commented on Oct 25, 2023

    @garloff
    Member

    Nice, this one is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

IAMSprint HobartSprint Izmir

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions