public inbox for [email protected]  
help / color / mirror / Atom feed
[patch][pgAdmin4] RM6832 oauth2 + internal authentication failure when order is changed in config file
2+ messages / 2 participants
[nested] [flat]

* [patch][pgAdmin4] RM6832 oauth2 + internal authentication failure when order is changed in config file
@ 2021-11-10 12:10 Rahul Shirsat <[email protected]>
  2021-11-11 07:26 ` Re: [patch][pgAdmin4] RM6832 oauth2 + internal authentication failure when order is changed in config file Akshay Joshi <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Rahul Shirsat @ 2021-11-10 12:10 UTC (permalink / raw)
  To: pgadmin-hackers

Hi Hackers,

Ensure that internal authentication when combined with other authentication
providers, the order of internal source should not matter while picking up
the provider.

-- 
*Rahul Shirsat*
Senior Software Engineer | EnterpriseDB Corporation.


Attachments:

  [application/octet-stream] RM6832.patch (765B, 3-RM6832.patch)
  download | inline diff:
diff --git a/web/pgAdmin4.py b/web/pgAdmin4.py
index dc1924cbd..851c107af 100644
--- a/web/pgAdmin4.py
+++ b/web/pgAdmin4.py
@@ -104,7 +104,13 @@ if config.SERVER_MODE:
 
 # Authentication sources
 if len(config.AUTHENTICATION_SOURCES) > 0:
-    app.PGADMIN_EXTERNAL_AUTH_SOURCE = config.AUTHENTICATION_SOURCES[0]
+    # Creating a temporary auth source list removing INTERNAL
+    # This change is done to avoid selecting INTERNAL authentication when user
+    # mistakenly keeps that the first option.
+    auth_source = [x for x in config.AUTHENTICATION_SOURCES
+                   if x != INTERNAL]
+    app.PGADMIN_EXTERNAL_AUTH_SOURCE = auth_source[0] \
+        if len(auth_source) > 0 else INTERNAL
 else:
     app.PGADMIN_EXTERNAL_AUTH_SOURCE = INTERNAL
 


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

* Re: [patch][pgAdmin4] RM6832 oauth2 + internal authentication failure when order is changed in config file
  2021-11-10 12:10 [patch][pgAdmin4] RM6832 oauth2 + internal authentication failure when order is changed in config file Rahul Shirsat <[email protected]>
@ 2021-11-11 07:26 ` Akshay Joshi <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Akshay Joshi @ 2021-11-11 07:26 UTC (permalink / raw)
  To: Rahul Shirsat <[email protected]>; +Cc: pgadmin-hackers

Thanks, the patch applied.

On Wed, Nov 10, 2021 at 5:41 PM Rahul Shirsat <
[email protected]> wrote:

> Hi Hackers,
>
> Ensure that internal authentication when combined with
> other authentication providers, the order of internal source should not
> matter while picking up the provider.
>
> --
> *Rahul Shirsat*
> Senior Software Engineer | EnterpriseDB Corporation.
>


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

*Mobile: +91 976-788-8246*


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


end of thread, other threads:[~2021-11-11 07:26 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 12:10 [patch][pgAdmin4] RM6832 oauth2 + internal authentication failure when order is changed in config file Rahul Shirsat <[email protected]>
2021-11-11 07:26 ` Akshay Joshi <[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