Top Methods
org.postgresql.plugin

public Interface AuthenticationPlugin

Imports
org.postgresql.util.PSQLException, org.checkerframework.checker.nullness.qual.Nullable

Method Summary

Modifier and TypeMethod and Description
public @Nullable char[]

Returns:

The password to use or null if no password is available
getPassword
(AuthenticationRequestType
The authentication method that the server is requesting
type
)

Callback method to provide the password to use for authentication.

Method Detail

getPasswordback to summary
public @Nullable char[] getPassword(AuthenticationRequestType type) throws PSQLException

Callback method to provide the password to use for authentication.

Implementers can also check the authentication type to ensure that the authentication handshake is using a specific authentication method (e.g. SASL) or avoiding a specific one (e.g. cleartext).

For security reasons, the driver will wipe the contents of the array returned by this method after it has been used for authentication.

Implementers must provide a new array each time this method is invoked as the previous contents will have been wiped.

Parameters
type:AuthenticationRequestType

The authentication method that the server is requesting

Returns:@Nullable char[]

The password to use or null if no password is available

Exceptions
PSQLException:
if something goes wrong supplying the password