|
|
@@ -15,15 +15,14 @@
|
|
|
# See the License for the specific language governing permissions and
|
|
|
# limitations under the License.
|
|
|
|
|
|
-import os
|
|
|
-import sys
|
|
|
import json
|
|
|
import logging
|
|
|
+import os
|
|
|
import subprocess
|
|
|
|
|
|
from django.utils.translation import gettext as _, gettext_lazy as _t
|
|
|
|
|
|
-from desktop.lib.conf import Config, coerce_bool, coerce_csv, coerce_password_from_script
|
|
|
+from desktop.lib.conf import coerce_bool, coerce_csv, coerce_password_from_script, Config
|
|
|
|
|
|
LOG = logging.getLogger()
|
|
|
|
|
|
@@ -215,6 +214,12 @@ REDIRECT_URL = Config(
|
|
|
default="",
|
|
|
help=_t("After log users out of control plane, CDP control plane redirect to this URL"))
|
|
|
|
|
|
+LOCAL_LOGOUT = Config(
|
|
|
+ key="local_logout",
|
|
|
+ type=coerce_bool,
|
|
|
+ default=True,
|
|
|
+ help=_t("Local logout only logout from Hue, but not IdP SAML"))
|
|
|
+
|
|
|
|
|
|
def get_key_file_password():
|
|
|
password = os.environ.get('HUE_SAML_KEY_FILE_PASSWORD')
|
|
|
@@ -237,8 +242,6 @@ def config_validator(user):
|
|
|
|
|
|
def get_logout_redirect_url():
|
|
|
# This logic was derived from KNOX.
|
|
|
- logout_url = CDP_LOGOUT_URL.get()
|
|
|
- redirect_url = "https://sso.cloudera.com/logout"
|
|
|
if REDIRECT_URL.get():
|
|
|
redirect_url = REDIRECT_URL.get()
|
|
|
elif any(substr in CDP_LOGOUT_URL.get() for substr in ['-dev', '-int', '-stage']):
|