Thank you for porting this on top of the pluggable auth methods API. I've addressed the feedback around other backend changes in my latest patch, but the client side changes still remain. I had a few questions to understand them better.
(a) What specifically do the client side changes in the patch implement?
(b) Are the changes you made on the client side specific to OAUTH or are they about making SASL more generic? As an additional question, if someone wanted to implement something similar on top of your patch, would they still have to make client side changes?
v3 rebases this patchset over the top of Samay's pluggable auth provider API [1], included here as patches 0001-3. The final patch in the set ports the server implementation from a core feature to a contrib module; to switch between the two approaches, simply leave out that final patch.
There are still some backend changes that must be made to get this working, as pointed out in 0009, and obviously libpq support still requires code changes.