Re: OAuth client code doesn't work with Google OAuth

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: OAuth client code doesn't work with Google OAuth
Date: 2025-09-08 07:01:24
Message-ID: CAN4CZFN5_8-X9RkOw3Dw7-8DaPzxzJn=9rEjKfw_og2ycOMMfg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In the previous email I attached a git diff not a proper patch file, I
added the correct attachment to this email.

On Sun, Sep 7, 2025 at 8:02 PM Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com> wrote:
>
> Hello Hackers,
>
> While working on an OAuth validator for PG18 I noticed that currently
> the client code doesn't work when using Google as the OAuth provider.
> It requires two small changes:
>
> * The device code request only includes the OAuth Client ID in the
> request body if the user doesn't specify a client secret (if the
> secret is specified, the client ID is only sent as part of the basic
> auth header), but Google OAuth always expects it in the body
> * The wait loop for the authorization only expects HTTP 400 and 401,
> but the Google endpoint responds with HTTP 428 (Precondition required)
>
> Both issues are testable/verifiable without a properly working
> validator, as they happen on the client side, before invoking the
> validator logic.
>
> I attached a small patch which fixes both.

Attachment Content-Type Size
0001-OIDC-client-should-work-with-Google-OAuth.patch application/octet-stream 2.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2025-09-08 07:03:24 Re: Set log_lock_waits=on by default
Previous Message Sophie Alpert 2025-09-08 06:57:21 Re: Fix missing EvalPlanQual recheck for TID scans