M
- Message typepublic interface AuthenticationPlugin<M extends Message>
isReusable()
) or a new instance
in each NativeAuthenticationProvider#proceedHandshakeWithPluggableAuthentication(String, String, String, Buffer) call.Modifier and Type | Method and Description |
---|---|
default void |
destroy()
Called by the driver when this extension should release any resources it is holding and cleanup internally before the connection is closed.
|
java.lang.String |
getProtocolPluginName()
Returns the client-side name that the MySQL server uses on the wire for this plugin.
|
default void |
init(Protocol<M> protocol)
We need direct Protocol reference because it isn't available from Connection before authentication complete.
|
default void |
init(Protocol<M> protocol,
MysqlCallbackHandler callbackHandler)
Initializes this plugin with a direct Protocol reference and a generic
MysqlCallbackHandler that can be used to pass over information back to the
authentication provider. |
boolean |
isReusable() |
boolean |
nextAuthenticationStep(M fromServer,
java.util.List<M> toServer)
Process authentication handshake data from server and optionally produce data to be sent back to the server.
|
boolean |
requiresConfidentiality()
Does this plugin require the connection itself to be confidential (i.e.
|
default void |
reset()
Resets the authentication steps sequence.
|
void |
setAuthenticationParameters(java.lang.String user,
java.lang.String password)
This method called from Connector/J before first nextAuthenticationStep call.
|
default void |
setSourceOfAuthData(java.lang.String sourceOfAuthData)
Connector/J uses this method to identify the source of the authentication data, as an authentication plugin name, that will be available to the next
authentication step(s).
|
default void init(Protocol<M> protocol)
protocol
- protocol instancedefault void init(Protocol<M> protocol, MysqlCallbackHandler callbackHandler)
MysqlCallbackHandler
that can be used to pass over information back to the
authentication provider.
For example an authentication plugin may accept null
usernames and use that information to obtain them from some external source, such as
the system login.protocol
- the protocol instancecallbackHandler
- a callback handler to provide additional information to the authentication providerdefault void reset()
default void destroy()
java.lang.String getProtocolPluginName()
boolean requiresConfidentiality()
boolean isReusable()
void setAuthenticationParameters(java.lang.String user, java.lang.String password)
user
- user namepassword
- user passworddefault void setSourceOfAuthData(java.lang.String sourceOfAuthData)
sourceOfAuthData
- the authentication plugin that is source of the authentication databoolean nextAuthenticationStep(M fromServer, java.util.List<M> toServer)
fromServer
- a buffer containing handshake data payload from
server (can be empty).toServer
- list of buffers with data to be sent to the server
(the list can be empty, but buffers in the list
should contain data).