Hello I have written a patch for the bug #6832
From 40a72af814c34080883f069fd239047df48b2b7b Mon Sep 17 00:00:00 2001 From: Florian Sabonchi <[email protected]> Date: Sat, 9 Oct 2021 12:57:49 +0200 Subject: [PATCH] fixe for Bug #6832
---
web/pgAdmin4.py | 5 ++++-
web/pgadmin/__init__.py | 6 ++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py
index dc1924cbd..5618ec245 100644
--- a/web/pgAdmin4.py
+++ b/web/pgAdmin4.py
@@ -103,7 +103,10 @@ if config.SERVER_MODE:
app.wsgi_app = ReverseProxied(app.wsgi_app)
# Authentication sources
-if len(config.AUTHENTICATION_SOURCES) > 0:
+if len(config.AUTHENTICATION_SOURCES) > 1 and \
+ config.AUTHENTICATION_SOURCES[1] != INTERNAL:
+ app.PGADMIN_EXTERNAL_AUTH_SOURCE = config.AUTHENTICATION_SOURCES[1]
+elif len(config.AUTHENTICATION_SOURCES) > 0:
app.PGADMIN_EXTERNAL_AUTH_SOURCE = config.AUTHENTICATION_SOURCES[0]
else:
app.PGADMIN_EXTERNAL_AUTH_SOURCE = INTERNAL
diff --git a/web/pgadmin/__init__.py b/web/pgadmin/__init__.py
index 37eb26ccc..0fa8c4c83 100644
--- a/web/pgadmin/__init__.py
+++ b/web/pgadmin/__init__.py
@@ -777,10 +777,8 @@ def create_app(app_name=None):
# but the user session may still be active. Logout the user
# to get the key again when login
if config.SERVER_MODE and current_user.is_authenticated and \
- app.PGADMIN_EXTERNAL_AUTH_SOURCE != \
- KERBEROS and app.PGADMIN_EXTERNAL_AUTH_SOURCE != \
- OAUTH2 and\
- current_app.keyManager.get() is None and \
+ app.PGADMIN_EXTERNAL_AUTH_SOURCE == INTERNAL and \
+ current_app.keyManager.get() is None and \
request.endpoint not in ('security.login', 'security.logout'):
logout_user()
--
2.25.1
OpenPGP_0x9B79A5A968AF5F8F.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
