pgAdmin4 + Authelia - OAUTH2

How to enable and configure OAUTH2 in pgAdmin4 together with Authelia.

pgAdmin4 + Authelia - OAUTH2

Recently I have deployed PostgreSQL database for paperless-ngx project I found useful to reduce paper at home. Since I like nice management GUIs a natural choice was to go for pgAdmin4 (in web, obviously). To add extra security layer to yet another publicly facing tool I decided to enable and configure Authelia OIDC.

You'll need following YML to add to Authelia configuration.yml:

Then on the pgAdmin4 side:

I have decided to use config_local.py mounted to /pgadmin4/config_local.py, since I had troubles setting compose environmentals in way that pgAdmin would not complain.

Replace:
- authelia.domain.com with whatever address your Authelia instance has
- fa-whateveryouwant with any FontAwesome icon you wish
- APPID and SUPERSECRET (see Authelia docs for details about these two)

Moreover I have disabled local logon to pgAdmin4 as no longer needed.