From 3b0abcbcd331f6db53e2040f6ff8759db233065c Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Thu, 15 Apr 2021 19:30:46 +0300 Subject: [PATCH] Implement WEBSSO redirect This patch adds ability to configure horizon auto redirections when WEBSSO is used. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/785800 Change-Id: I2a1beddaed3a31d1c01d1310dc8b739c9c93d9dd Closes-Bug: #1922687 --- defaults/main.yml | 4 ++++ .../notes/horizon_websso_redirect-662cbf01b431efb1.yaml | 9 +++++++++ templates/horizon_local_settings.py.j2 | 9 +++++++++ 3 files changed, 22 insertions(+) create mode 100644 releasenotes/notes/horizon_websso_redirect-662cbf01b431efb1.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 6c5524c9..801c3ab0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -483,4 +483,8 @@ horizon_keystone_admin_roles: # Set the "credentials" authentication choice to show as default. # The list of authentication mechanisms which include keystone # federation protocols and identity provider/federation protocol +#horizon_websso_keystone_url: "{{ horizon_keystone_endpoint }}" horizon_websso_initial_choice: "credentials" +horizon_websso_default_redirect: False +horizon_websso_default_redirect_region: "{{ horizon_websso_keystone_url | default(horizon_keystone_endpoint) }}" +horizon_websso_default_redirect_logout: "" diff --git a/releasenotes/notes/horizon_websso_redirect-662cbf01b431efb1.yaml b/releasenotes/notes/horizon_websso_redirect-662cbf01b431efb1.yaml new file mode 100644 index 00000000..9b145277 --- /dev/null +++ b/releasenotes/notes/horizon_websso_redirect-662cbf01b431efb1.yaml @@ -0,0 +1,9 @@ +--- +features: + - | + Implemented horizon WEBSSO auto redirects. Following new variables + were added to manage redirects configuration: + + - horizon_websso_default_redirect + - horizon_websso_default_redirect_region + - horizon_websso_default_redirect_logout diff --git a/templates/horizon_local_settings.py.j2 b/templates/horizon_local_settings.py.j2 index 7b887b5f..47433d37 100644 --- a/templates/horizon_local_settings.py.j2 +++ b/templates/horizon_local_settings.py.j2 @@ -190,6 +190,15 @@ WEBSSO_INITIAL_CHOICE = "{{ horizon_websso_initial_choice }}" WEBSSO_KEYSTONE_URL = "{{ horizon_websso_keystone_url }}" {% endif %} +{% if horizon_websso_default_redirect | bool %} +WEBSSO_DEFAULT_REDIRECT = "{{ horizon_websso_default_redirect }}" +WEBSSO_DEFAULT_REDIRECT_PROTOCOL = "{{ horizon_websso_initial_choice }}" +WEBSSO_DEFAULT_REDIRECT_REGION = "{{ horizon_websso_default_redirect_region }}" +{% if horizon_websso_default_redirect_logout | length > 0 %} +WEBSSO_DEFAULT_REDIRECT_LOGOUT = "{{ horizon_websso_default_redirect_logout }}" +{% endif %} +{% endif %} + # The list of authentication mechanisms which include keystone # federation protocols and identity provider/federation protocol # mapping keys (WEBSSO_IDP_MAPPING). Current supported protocol