public enum AuthMethod extends java.lang.Enum<AuthMethod>
| Enum Constant and Description |
|---|
GSS |
MD5 |
NONE |
PASSWORD |
SCRAM_SHA_256 |
SSPI |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkAuth(java.util.EnumSet<AuthMethod> allowedMethods,
AuthMethod authMethod)
Refuses an authentication method that
requireAuth does not allow. |
static AuthMethod |
fromString(java.lang.String method) |
static java.util.EnumSet<AuthMethod> |
parseRequireAuth(java.lang.String requireAuth)
Parses a
requireAuth value into the authentication methods the
server may request. |
static AuthMethod |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static AuthMethod[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final AuthMethod NONE
public static final AuthMethod PASSWORD
public static final AuthMethod MD5
public static final AuthMethod GSS
public static final AuthMethod SSPI
public static final AuthMethod SCRAM_SHA_256
public static AuthMethod[] values()
for (AuthMethod c : AuthMethod.values()) System.out.println(c);
public static AuthMethod valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static AuthMethod fromString(java.lang.String method) throws PSQLException
PSQLExceptionpublic static java.util.EnumSet<AuthMethod> parseRequireAuth(java.lang.String requireAuth) throws PSQLException
requireAuth value into the authentication methods the
server may request.requireAuth - comma-separated method names, either all plain or all
prefixed with !null when requireAuth is null, and
checkAuth(java.util.EnumSet<org.postgresql.core.AuthMethod>, org.postgresql.core.AuthMethod) allows every method for null; otherwise the
allowed methods, empty when the value excludes every methodPSQLException - with PSQLState.INVALID_PARAMETER_VALUE if
the value mixes the two forms, names a method twice, names an unknown
method, or is written without a methodpublic static void checkAuth(java.util.EnumSet<AuthMethod> allowedMethods, AuthMethod authMethod) throws PSQLException
requireAuth does not allow.allowedMethods - the methods to allow, or null to allow
every method; an empty set refuses every methodauthMethod - the method the server asked forPSQLException - with PSQLState.CONNECTION_REJECTED if the
method is not allowedCopyright © 2026 PostgreSQL Global Development Group. All rights reserved.