Does Azure PostgresSQL flexible server (Postgres 18) support OAuth2 authentication?

Dutsadi Bunliang 0 Reputation points
2026-11-14T15:40:09.71+00:00

Hi, we are looking for a way to make our Azure PostgresSQL flexible server to allow token-based authentication via Postgres’s native OAuth authentication (https://www.postgresql.org/docs/current/auth-oauth.html).

In the Azure Portal for our Azure PostgresSQL flexible server, we can set the server parameter pg_oidc_validator value to “pg_oidc_validator” but cannot add new entry to the pg_hba server parameter to define our OAuth issuer URL (https://github.com/percona/pg_oidc_validator).

Do we have a way add a new entry to the pg_hba.conf as not all of our user organizations uses Entra Id?

Azure Database for PostgreSQL

Answer accepted by question author
SHOUMIK CHAKRAVARTY 1,455 Reputation points
2026-11-14T16:33:35.0933333+00:00

Hi @Dutsadi Bunliang - welcome to the Microsoft Azure QnA.

Adding the specific documentation behind each of the points already raised here.

pg_oidc_validator is not available. It does not appear on the list of extensions Flexible Server supports, so setting the parameter does not install it.

pg_hba.conf is not editable. From Server parameters: “Because Azure Database for PostgreSQL is a managed database service, you don’t have host or operating system access to view or modify configuration files such as postgresql.conf.” pg_hba does not appear anywhere on that page, so there is no parameter for it either.

The supported methods are a closed list, not just an absence of documentation. From Microsoft Entra authentication: “Azure Database for PostgreSQL supports three modes of authentication: PostgreSQL authentication only, Microsoft Entra authentication only, and both PostgreSQL and Microsoft Entra authentication.” An OIDC provider outside Entra is not among them.

So for your users who are not in Entra ID, that leaves local PostgreSQL usernames and passwords, or representing those users in your Entra tenant. Since the supported set is enumerated, I would not plan around an external issuer arriving.

If this helps resolve your question, please accept the answer or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Oldest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.