This page in other versions: Latest (6.2) | 6.1 | 6.0 | 5.7 | Development

This document in other formats: PDF | ePub | Tarball


Enabling OAUTH2 Authentication

To enable OAUTH2 authentication for pgAdmin, you must configure the OAUTH2 settings in the or file (see the documentation) on the system where pgAdmin is installed in Server mode. You can copy these settings from file and modify the values for the following parameters:




The default value for this parameter is internal. To enable OAUTH2 authentication, you must include oauth2 in the list of values for this parameter. you can modify the value as follows:

  • [‘oauth2’, ‘internal’]: pgAdmin will display an additional button for authenticating with oauth2


The name of the Oauth2 provider, ex: Google, Github


Oauth2 display name in pgAdmin


Oauth2 Client ID


Oauth2 Client Secret


Oauth2 Access Token endpoint


Endpoint for user authorization


Oauth2 base URL endpoint to make requests simple, ex:


User Endpoint, ex: user (for github) and useinfo (for google)


Oauth scope, ex: ‘openid email profile’. Note that an ‘email’ claim is required in the resulting profile.


The Font-awesome icon to be placed on the oauth2 button, ex: fa-github


Oauth2 button color


Set the value to True if you want to automatically

create a pgAdmin user corresponding to a successfully authenticated Oauth2 user. Please note that password is not stored in the pgAdmin database.

Redirect URL

The redirect url to configure Oauth2 server is http://<pgAdmin Server URL>/oauth2/authorize

Master Password

In the multi user mode, pgAdmin uses user’s login password to encrypt/decrypt the PostgreSQL server password. In the Oauth2 authentication, the pgAdmin does not store the user’s password, so we need an encryption key to store the PostgreSQL server password. To accomplish this, set the configuration parameter MASTER_PASSWORD to True, so upon setting the master password, it will be used as an encryption key while storing the password. If it is False, the server password can not be stored.

Login Page

After configuration, on restart, you can see the login page with the Oauth2 login button(s).

Oauth2 login