Skip to content

SCRAM authentication correctness/improvements #710

@v0idpwn

Description

@v0idpwn

Bug report

Describe the bug

Currently, Supavisor returns SCRAM errors in the scram-server-final message error field. The message is an arbitrary string. psql, Postgrex, and some other clients handle this gracefully and show this error to the user.

Some other clients have different behaviour:

Postgres leverages the fact that SCRAM allows you to return non-scram errors instead of returning scram-server-final, to ensure consistency across different auth methods and return "postgres errors" instead of "scram errors", see the comment: https://github.com/postgres/postgres/blob/2047ad068139f0b8c6da73d0b845ca9ba30fb33d/src/backend/libpq/auth-scram.c#L423.

Expected behavior

Align our behaviour with Postgres' to improve the auth errors saw by clients.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions