Re: [PoC] Federated Authn/z with OAUTHBEARER

From: Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Peter Eisentraut <peter(at)eisentraut(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PoC] Federated Authn/z with OAUTHBEARER
Date: 2024-10-16 17:21:54
Message-ID: CAOYmi+=w+igiML2F5E4Mgz6_bnxa2Wa1o9pvA2OkV630ZHwq2g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 10, 2024 at 4:08 PM Jacob Champion
<jacob(dot)champion(at)enterprisedb(dot)com> wrote:
> Here's v30, which aims to fix the infinite-retry problem: you get a
> maximum of two OAuth connections to the server, and we won't prompt
> the user more than once per transport. (I still need to wrap my head
> around the retry behavior during transport negotiation.)

v31 folds in the remainder of the review patch (hooray!) and makes a
change to the 401 handling. If the server doesn't tell the client why
a token request failed, but we see that we got a 401 Unauthorized, the
error message now suggests that the oauth_client_secret setting is
unacceptable.

(If anyone out there happens to be testing this against real-world
implementations, I would love to get your feedback on this failure
mode. I can no longer get Entra ID to require a client secret during a
device flow, the way I used to be able to with Azure AD.)

I've also made the default device prompt translatable.

--Jacob

Attachment Content-Type Size
since-v30.diff.txt text/plain 14.9 KB
v31-0001-Make-SASL-max-message-length-configurable.patch application/octet-stream 2.8 KB
v31-0002-libpq-add-OAUTHBEARER-SASL-mechanism.patch application/octet-stream 122.3 KB
v31-0003-backend-add-OAUTHBEARER-SASL-mechanism.patch application/octet-stream 77.8 KB
v31-0004-DO-NOT-MERGE-Add-pytest-suite-for-OAuth.patch application/octet-stream 182.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2024-10-16 17:26:57 Re: DOCS - pg_replication_slot . Fix the 'inactive_since' description
Previous Message Peter Geoghegan 2024-10-16 17:14:29 Re: Adding skip scan (including MDAM style range skip scan) to nbtree