public inbox for [email protected]  
help / color / mirror / Atom feed
From: Florian Sabonchi <[email protected]>
To: [email protected]
Subject: Patch for Bug #6832
Date: Sat,  9 Oct 2021 11:02:48 +0000
Message-ID: <[email protected]> (raw)

Hello I have written a patch for the bug #6832



Attachments:

  [text/x-patch] 0001-fixe-for-Bug-6832.patch (1.8K, 2-0001-fixe-for-Bug-6832.patch)
  download | inline diff:
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



  [application/pgp-keys] OpenPGP_0x9B79A5A968AF5F8F.asc (2.4K, 3-OpenPGP_0x9B79A5A968AF5F8F.asc)
  download

  [application/pgp-signature] OpenPGP_signature (665B, 4-OpenPGP_signature)
  download

view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected]
  Subject: Re: Patch for Bug #6832
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox