Credential
public enum Credential
A credential for authenticating to the Postgres server.
PostgresClientKit supports trust, password, md5, and scram-sha-256 authentication.
The configuration of the Postgres server determines which authentication types are allowed.
See also
Postgres: Client Authentication.-
Connects without authenticating.
Declaration
Swift
case trust -
Authenticates by cleartext password. Not recommended unless the connection is encrypted by SSL/TLS (see
ConnectionConfiguration.ssl).Declaration
Swift
case cleartextPassword(password: String) -
Authenticates by MD5 hash of the username (
ConnectionConfiguration.user), password, and random salt.Declaration
Swift
case md5Password(password: String) -
Authenticates using SCRAM-SHA-256 (RFC 7677). This is the most secure authentication method.
Declaration
Swift
case scramSHA256(password: String)