public inbox for [email protected]  
help / color / mirror / Atom feed
Patch for Bug #6832
3+ messages / 3 participants
[nested] [flat]

* Patch for Bug #6832
@ 2021-10-09 11:02  Florian Sabonchi <[email protected]>
  0 siblings, 2 replies; 3+ messages in thread

From: Florian Sabonchi @ 2021-10-09 11:02 UTC (permalink / raw)
  To: pgadmin-hackers

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

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Patch for Bug #6832
@ 2021-10-13 11:21  Akshay Joshi <[email protected]>
  parent: Florian Sabonchi <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Akshay Joshi @ 2021-10-13 11:21 UTC (permalink / raw)
  To: Florian Sabonchi <[email protected]>; Khushboo Vashi <[email protected]>; +Cc: pgadmin-hackers

Khushboo,

Can you please review the patch?

On Wed, Oct 13, 2021 at 4:03 PM Florian Sabonchi <[email protected]> wrote:

> Hello I have written a patch for the bug #6832
>
>

-- 
*Thanks & Regards*
*Akshay Joshi*
*pgAdmin Hacker | Principal Software Architect*
*EDB Postgres <http://edbpostgres.com>*

*Mobile: +91 976-788-8246*


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Patch for Bug #6832
@ 2021-10-18 06:14  Khushboo Vashi <[email protected]>
  parent: Florian Sabonchi <[email protected]>
  1 sibling, 0 replies; 3+ messages in thread

From: Khushboo Vashi @ 2021-10-18 06:14 UTC (permalink / raw)
  To: Florian Sabonchi <[email protected]>; +Cc: pgadmin-hackers

Hi Florian,

The patch will fail if we have AUTHENTICATION_SOURCES = ['ldap', 'oauth2']
settings.
Also, please rebase your patch.

Thanks,
Khushboo



On Wed, Oct 13, 2021 at 4:03 PM Florian Sabonchi <[email protected]> wrote:

> Hello I have written a patch for the bug #6832
>
>


^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-10-18 06:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-09 11:02 Patch for Bug #6832 Florian Sabonchi <[email protected]>
2021-10-13 11:21 ` Akshay Joshi <[email protected]>
2021-10-18 06:14 ` Khushboo Vashi <[email protected]>

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