public class AuthenticationKerberosClient extends java.lang.Object implements AuthenticationPlugin<NativePacketPayload>
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
AUTHENTICATION_MECHANISM |
private java.lang.String |
cachedPrincipalName |
private javax.security.auth.callback.CallbackHandler |
credentialsCallbackHandler |
private static java.lang.String |
LOGIN_CONFIG_ENTRY |
private java.lang.String |
password |
static java.lang.String |
PLUGIN_NAME |
private javax.security.sasl.SaslClient |
saslClient |
private java.lang.String |
sourceOfAuthData |
private javax.security.auth.Subject |
subject |
private java.lang.String |
user |
private MysqlCallbackHandler |
usernameCallbackHandler |
private java.lang.String |
userPrincipalName |
| Constructor and Description |
|---|
AuthenticationKerberosClient() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
init(Protocol<NativePacketPayload> prot,
MysqlCallbackHandler cbh)
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. |
private void |
initializeAuthentication() |
boolean |
isReusable() |
boolean |
nextAuthenticationStep(NativePacketPayload fromServer,
java.util.List<NativePacketPayload> 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.
|
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.
|
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).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitpublic static java.lang.String PLUGIN_NAME
private static final java.lang.String LOGIN_CONFIG_ENTRY
private static final java.lang.String AUTHENTICATION_MECHANISM
private java.lang.String sourceOfAuthData
private MysqlCallbackHandler usernameCallbackHandler
private java.lang.String user
private java.lang.String password
private java.lang.String userPrincipalName
private javax.security.auth.Subject subject
private java.lang.String cachedPrincipalName
private javax.security.auth.callback.CallbackHandler credentialsCallbackHandler
private javax.security.sasl.SaslClient saslClient
public void init(Protocol<NativePacketPayload> prot, MysqlCallbackHandler cbh)
AuthenticationPluginMysqlCallbackHandler 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.init in interface AuthenticationPlugin<NativePacketPayload>prot - the protocol instancecbh - a callback handler to provide additional information to the authentication providerpublic void reset()
AuthenticationPluginreset in interface AuthenticationPlugin<NativePacketPayload>public void destroy()
AuthenticationPlugindestroy in interface AuthenticationPlugin<NativePacketPayload>public java.lang.String getProtocolPluginName()
AuthenticationPlugingetProtocolPluginName in interface AuthenticationPlugin<NativePacketPayload>public boolean requiresConfidentiality()
AuthenticationPluginrequiresConfidentiality in interface AuthenticationPlugin<NativePacketPayload>public boolean isReusable()
isReusable in interface AuthenticationPlugin<NativePacketPayload>public void setAuthenticationParameters(java.lang.String user,
java.lang.String password)
AuthenticationPluginsetAuthenticationParameters in interface AuthenticationPlugin<NativePacketPayload>user - user namepassword - user passwordpublic void setSourceOfAuthData(java.lang.String sourceOfAuthData)
AuthenticationPluginsetSourceOfAuthData in interface AuthenticationPlugin<NativePacketPayload>sourceOfAuthData - the authentication plugin that is source of the authentication datapublic boolean nextAuthenticationStep(NativePacketPayload fromServer, java.util.List<NativePacketPayload> toServer)
AuthenticationPluginnextAuthenticationStep in interface AuthenticationPlugin<NativePacketPayload>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).private void initializeAuthentication()