Class SendPamAuthPacket
java.lang.Object
org.mariadb.jdbc.plugin.authentication.standard.SendPamAuthPacket
- All Implemented Interfaces:
AuthenticationPlugin
PAM (dialog) authentication plugin. This is a multi-step exchange password. If more than one
step, passwordX (password2, password3, ...) options must be set.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSendPamAuthPacket(String authenticationData, Configuration conf) Initialization. -
Method Summary
Modifier and TypeMethodDescriptionprivate static AuthDialogCallbackLook up the application-registeredAuthDialogCallbackviaServiceLoader.Process PAM plugin authentication.private StringresolvePassword(ReadableByteBuf serverPacket) Pick the answer for the current PAM/dialog round.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AuthenticationPlugin
hash, isMitMProof
-
Field Details
-
authenticationData
-
conf
-
counter
private int counter
-
-
Constructor Details
-
SendPamAuthPacket
Initialization.- Parameters:
authenticationData- authentication data (password/token)conf- Connection string options
-
-
Method Details
-
process
public ReadableByteBuf process(Writer out, Reader in, Context context, boolean sslFingerPrintValidation) throws SQLException, IOException Process PAM plugin authentication. see https://mariadb.com/kb/en/library/authentication-plugin-pam/- Specified by:
processin interfaceAuthenticationPlugin- Parameters:
out- out streamin- in streamcontext- connection contextsslFingerPrintValidation- true if SSL certificate fingerprint validation is enabled- Returns:
- response packet
- Throws:
IOException- if socket errorSQLException- if plugin exception
-
resolvePassword
Pick the answer for the current PAM/dialog round. Round 1 uses the connection password, later rounds prefer the application-registeredAuthDialogCallback(so a UI can surface the actual server prompt). When no callback is registered, or the callback returnsnull, we fall back to the historicalpasswordNURL options.- Throws:
SQLException
-
dialogCallback
Look up the application-registeredAuthDialogCallbackviaServiceLoader. Java equivalent of the C connector'sdlsym(RTLD_DEFAULT, "mariadb_auth_dialog"). Returnsnullwhen nothing is registered.
-