Skip to content

Commit b75fe43

Browse files
Jason Andersonmsherman64
authored andcommitted
Invalidate local Keystone session on logout
When logging out of Horizon, the user's Horizon session would be cleared, and they would then be taken to the Chameleon IdP so that session could also be cleared. However, their session was still persisted thanks to caching in the mod_auth_openidc Apache module Keystone uses for its OpenID integration[1]. To fix, expand the logout chain to also hit the mod_auth_openidc logout endpoint[2]. [1]: https://github.com/zmartzone/mod_auth_openidc/wiki/Caching [2]: https://github.com/zmartzone/mod_auth_openidc/wiki/OpenID-Connect-Session-Management#logout [federated auth] enable logout via keystone+keycloak
1 parent 7be30ef commit b75fe43

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

site-config/globals.yml

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,21 @@ keystone_identity_mappings:
8484

8585
keystone_oidc_client_id: "keystone-ciab-dev"
8686
keystone_oidc_client_secret: "public"
87-
keystone_oidc_provider_metadata_url: "{{ keystone_identity_providers[0].identifier }}/.well-known/openid-configuration"
88-
87+
identity_provider_url: "{{ keystone_identity_providers[0].identifier }}"
88+
keystone_oidc_provider_metadata_url: "{{ identity_provider_url }}/.well-known/openid-configuration"
89+
keystone_federation_oidc_jwks_uri: "{{ identity_provider_url }}/protocol/openid-connect/certs"
90+
91+
# required for horizon logout, must have mod_auth_openidc version >= 4.3.3
92+
# 1. horizon redirects to keystone with parameter logout=keystone_oidc_logout_payload
93+
# 2. mod_auth_openidc in keystone clears its local cache, then redirects to the "post-logout" api endpoint in keycloak
94+
# 3. (our custom) post-logout api endpoint in keycloak ends the active session, then displays a page with links to sign-out of globus and TAS
95+
keystone_oidc_logout_payload: '{{ (identity_provider_url ~ "/post-logout?client_id=" ~ keystone_oidc_client_id) | urlencode }}'
96+
keystone_federation_oidc_allowed_redirects:
97+
- "^{{ keystone_public_url }}/"
98+
- "^{{ identity_provider_url }}/"
99+
89100
# keystone must support mapping multiple projects or keycloak federation will fail
90-
keystone_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-keystone:77cca74
91-
keystone_fernet_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-keystone-fernet:77cca74
92-
keystone_ssh_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-keystone-ssh:77cca74
93-
horizon_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-horizon:77cca74
101+
keystone_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-keystone:e400612
102+
keystone_fernet_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-keystone-fernet:e400612
103+
keystone_ssh_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-keystone-ssh:e400612
104+
horizon_image_full: ghcr.io/chameleoncloud/kolla/ubuntu-source-horizon:e400612

site-config/node_custom_config/horizon/custom_local_settings

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ WEBSSO_DEFAULT_REDIRECT = True
120120
WEBSSO_KEYSTONE_URL = "{{ keystone_public_url }}/v3"
121121
WEBSSO_DEFAULT_REDIRECT_REGION = '{{ keystone_public_url }}/v3'
122122
WEBSSO_DEFAULT_REDIRECT_PROTOCOL = 'openid'
123+
# Use mod_auth_openidc's built-in front channel logout support (part of the
124+
# OpenID spec.) If we make a request to the `OIDCRedirectURI` with a ?logout
125+
# parameter set to a valid redirect URI, the user's session will be cleared both
126+
# within the mod_auth_openidc session cache, but also on the authenticating
127+
# provider itself. We redirect to the custom post-logout page.
128+
WEBSSO_DEFAULT_REDIRECT_LOGOUT = '{{ keystone_public_url }}/redirect_uri?logout={{ keystone_oidc_logout_payload }}'
129+
123130
{% endif %}
124131

125132
# The OPENSTACK_HEAT_STACK has the only setting available - enable_user_pass,

0 commit comments

Comments
 (0)