Hi, On 2022-02-25 14:10:39 -0500, Tom Lane wrote: > I'm happy to add support for custom auth methods if they can use > a protocol that's safer than cleartext-password. But if that's the > only feasible option, then we're just encouraging people to use > insecure methods.
It looks like scram can be used without much trouble. All the necessary infrastructure to implement it without duplication appears to be public. The plugin would need to get a secret from whereever and call CheckSASLAuth(&pg_be_scram_mech, port, shadow_pass, logdetail); or if it needs to do something more complicated than CheckSASLAuth(), it can use AUTH_REQ_SASL{,_FIN CONT} itself. Of course whether it's viable depends on what the custom auth method wants to do. But it's not a restriction of the authentication plugin model. Greetings, Andres Freund